This commit is contained in:
suyl
2021-08-17 11:14:18 +08:00
parent 3a3d1d2f4f
commit c40ee75121

View File

@@ -1,6 +1,8 @@
package controllers package controllers
import ( import (
"bytes"
"encoding/base64"
"net/http" "net/http"
"git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/baseapi/utils"
@@ -29,7 +31,14 @@ func (c *DingDingController) Msg() {
// callbackResponse = api.DingDingAPI.Err2CallbackResponse(nil) // callbackResponse = api.DingDingAPI.Err2CallbackResponse(nil)
// } // }
//} //}
callbackResponse = api.DingDingAPI.PackCallbackResult("success") aesKey := api.DingDingAPI.GetCallbackAESKey()
buf := bytes.NewBuffer(nil)
//buf.WriteString(utils.GetUUID()[:16])
//binary.Write(buf, binary.BigEndian, int32(len("success")))
buf.WriteString("success")
//buf.WriteString(a.corpID)
binResult, _ := utils.AESCBCEncpryt(buf.Bytes(), aesKey, aesKey[:16])
callbackResponse.Encrypt = base64.StdEncoding.EncodeToString(binResult)
c.Data["json"] = callbackResponse c.Data["json"] = callbackResponse
c.ServeJSON() c.ServeJSON()
} else { } else {