This commit is contained in:
ZhuoQinghui 2024-10-31 11:51:34 +08:00
parent 4429072e0c
commit 5cf96d8ab3

View File

@ -79,12 +79,24 @@ func getCert(c *gin.Context) {
}
key := string(keyContent)
certInfoFilePath := path.Join(dir, CertInfoFileName)
certInfoContent, err := os.ReadFile(certInfoFilePath)
if err != nil {
c.JSON(200, gin.H{
"code": 500,
"msg": "Failed to read cert info file.",
})
return
}
certInfo := string(certInfoContent)
c.JSON(200, gin.H{
"code": 200,
"msg": "Success",
"data": gin.H{
"crt": encryptResult(crt, token),
"key": encryptResult(key, token),
"info": encryptResult(certInfo, token),
},
})
}