|
@@ -68,8 +68,8 @@ func Login(c *gin.Context) {
|
|
|
|
|
|
// 消息解密请求参数
|
|
|
type EncryptReq struct {
|
|
|
- EncryptedData string
|
|
|
- Iv string
|
|
|
+ EncryptedData string
|
|
|
+ Iv string
|
|
|
}
|
|
|
|
|
|
// GetEncryptInfo 消息解密
|
|
@@ -82,7 +82,7 @@ type EncryptReq struct {
|
|
|
// @Param iv query string true "加密算法初始向量"
|
|
|
// @Success 200 {string} string "获取成功"
|
|
|
// @Router /wechat/getEncryptInfo [post]
|
|
|
-func GetEncryptInfo(c *gin.Context) {
|
|
|
+func GetEncryptInfo(c *gin.Context) {
|
|
|
var req EncryptReq
|
|
|
err := c.ShouldBind(&req)
|
|
|
if err != nil {
|
|
@@ -99,13 +99,13 @@ func GetEncryptInfo(c *gin.Context) {
|
|
|
}
|
|
|
// 获取登录用户信息
|
|
|
userInfo := user.GetInfoByClaims(c)
|
|
|
- if userInfo.SessionKey == "" {
|
|
|
+ if userInfo.RecordInfo.SessionKey == "" {
|
|
|
response.Fail("请重新登录", c)
|
|
|
return
|
|
|
}
|
|
|
decryptData, err := wx_app.GetDecryptInfo(userInfo.SessionKey, req.EncryptedData, req.Iv)
|
|
|
if err != nil {
|
|
|
- response.Fail("获取失败,Err:" + err.Error(), c)
|
|
|
+ response.Fail("获取失败,Err:"+err.Error(), c)
|
|
|
return
|
|
|
}
|
|
|
response.OkData("获取成功", decryptData, c)
|