From 5cf96d8ab31882fa4e753fe63e8a0d31af434847 Mon Sep 17 00:00:00 2001 From: ZhuoQinghui <1302344380@qq.com> Date: Thu, 31 Oct 2024 11:51:34 +0800 Subject: [PATCH] list --- src/http.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/http.go b/src/http.go index 6763346..d5dc954 100644 --- a/src/http.go +++ b/src/http.go @@ -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), + "crt": encryptResult(crt, token), + "key": encryptResult(key, token), + "info": encryptResult(certInfo, token), }, }) }