新增修改用户手机号为微信绑定的手机号,user2/UpdateUserByMiniInfo
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/weixinapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/auth2"
|
||||
"git.rosy.net.cn/jx-callback/business/auth2/authprovider/dingding"
|
||||
@@ -14,7 +13,6 @@ import (
|
||||
"git.rosy.net.cn/jx-callback/business/auth2/authprovider/password"
|
||||
"git.rosy.net.cn/jx-callback/business/auth2/authprovider/weixin"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"github.com/astaxie/beego"
|
||||
)
|
||||
@@ -297,30 +295,3 @@ func (c *Auth2Controller) ChangePassword() {
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 解密小程序数据
|
||||
// @Description 解密小程序数据
|
||||
// @Param token header string true "认证token"
|
||||
// @Param data formData string true "加密数据"
|
||||
// @Param iv formData string true "iv"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /MiniDecryptData [post]
|
||||
func (c *Auth2Controller) MiniDecryptData() {
|
||||
c.callMiniDecryptData(func(params *tAuth2MiniDecryptDataParams) (retVal interface{}, errCode string, err error) {
|
||||
authInfo, err := params.Ctx.GetV2AuthInfo()
|
||||
if err == nil {
|
||||
decryptedDataBase64, err2 := weixin.AutherObjMini.DecryptData(authInfo, params.Data, params.Iv)
|
||||
if err = err2; err == nil {
|
||||
var userInfo *weixinapi.MiniUserInfo
|
||||
if err = utils.UnmarshalUseNumber([]byte(decryptedDataBase64), &userInfo); err == nil {
|
||||
if user := params.Ctx.GetFullUser(); user != nil {
|
||||
user.Avatar = userInfo.AvatarURL
|
||||
dao.UpdateEntity(dao.GetDB(), user, "Avatar")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user