This commit is contained in:
苏尹岚
2020-11-20 12:04:24 +08:00
parent e501c1beaf
commit 750ad8fb9a

View File

@@ -1,8 +1,6 @@
package controllers
import (
"fmt"
"git.rosy.net.cn/baseapi/platformapi/weixinapi"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/auth2"
@@ -289,7 +287,7 @@ func (c *User2Controller) UpdateUserByMiniInfo() {
}
type UserInfoWithWeixin struct {
*weixinapi.MiniUserInfo
UserInfo *weixinapi.MiniUserInfo `json:"userInfo"`
IsExist bool `json:"isExist"`
}
@@ -310,9 +308,8 @@ func (c *User2Controller) GetUserByMiniInfo() {
if err = err2; err == nil {
var userInfo *weixinapi.MiniUserInfo
if err = utils.UnmarshalUseNumber([]byte(decryptedDataBase64), &userInfo); err == nil {
fmt.Println("1111", utils.Format4Output(userInfo, false))
var result *UserInfoWithWeixin
if err = utils.UnmarshalUseNumber(utils.MustMarshal(userInfo), &result); err == nil {
result.UserInfo = userInfo
if userInfo.PhoneNumber != "" {
if user, err := dao.GetUserByID(dao.GetDB(), "mobile", userInfo.PhoneNumber); err == nil {
if user != nil {
@@ -320,17 +317,12 @@ func (c *User2Controller) GetUserByMiniInfo() {
} else {
result.IsExist = false
}
fmt.Println("22222", utils.Format4Output(result, false))
retVal = result
}
}
} else {
fmt.Println(err)
}
}
}
}
fmt.Println("33333", utils.Format4Output(retVal, false))
return retVal, "", err
})
}