|
|
@@ -224,10 +224,6 @@ func (self *PermitController) SaveWxuserInfo() {
|
|
|
self.ReturnError(403, apps.WxUserInfoError, "", nil)
|
|
|
}
|
|
|
wxUser.UploadHead(info.AvatarUrl)
|
|
|
- type Ret struct {
|
|
|
- Result bool `json:"result"`
|
|
|
- Head string `json:"head"`
|
|
|
- }
|
|
|
|
|
|
//更新用户信息
|
|
|
wxUser.Nickname = info.NickName
|
|
|
@@ -237,7 +233,7 @@ func (self *PermitController) SaveWxuserInfo() {
|
|
|
wxUser.Country = info.Country
|
|
|
wxUser.Save()
|
|
|
|
|
|
- user := user_model.GetWxUserById(wxUser.UserId, true)
|
|
|
+ user := user_model.GetUserById(wxUser.UserId, true)
|
|
|
if user != nil {
|
|
|
user.Nickname = wxUser.Nickname
|
|
|
user.Country = wxUser.Country
|
|
|
@@ -245,11 +241,15 @@ func (self *PermitController) SaveWxuserInfo() {
|
|
|
user.City = wxUser.City
|
|
|
user.Sex = wxUser.Sex
|
|
|
user.Save()
|
|
|
+ go user.CopyWxUserHead(wxUser.Head)
|
|
|
}
|
|
|
|
|
|
headImag := tool.GetCdnFullImgUrl(wxUser.Head)
|
|
|
//beego.BeeLogger.Info("save_wx_user_info err: %v ", wxUser)
|
|
|
-
|
|
|
+ type Ret struct {
|
|
|
+ Result bool `json:"result"`
|
|
|
+ Head string `json:"head"`
|
|
|
+ }
|
|
|
self.Data["json"] = &Ret{Result: true, Head: headImag}
|
|
|
self.ServeJSON()
|
|
|
}
|