rdluck 4 years ago
parent
commit
9c1cd636e9
2 changed files with 3 additions and 1 deletions
  1. 2 0
      controllers/wechat.go
  2. 1 1
      models/user_record.go

+ 2 - 0
controllers/wechat.go

@@ -384,6 +384,8 @@ func (this *WechatController) GetUserInfo() {
 	fmt.Println("sessionKey:", sessionKey)
 	fmt.Println(sessionKey, req.RawData, req.EncryptedData, req.Signature, req.Iv)
 	userInfo, err := weapp.DecryptUserInfo(sessionKey, req.RawData, req.EncryptedData, req.Signature, req.Iv)
+	fmt.Println("weapp.DecryptUserInfo ",err)
+
 	if err != nil {
 		br.Msg = "解析用户信息失败"
 		br.ErrMsg = "解析用户信息失败,DecryptUserInfo Err:" + err.Error()

+ 1 - 1
models/user_record.go

@@ -56,7 +56,7 @@ func BindUserRecordByOpenid(userId int, openId, bindAccount string) (err error)
 //修改用户微信信息
 func ModifyUserRecordInfo(openId, nickName, headimgUrl, city, province, country string, sex, userId int) (err error) {
 	o := orm.NewOrm()
-	sql := `UPDATE user_record SET nick_name=?,headimgurl=?,sex=?,city=?,province=?,country=? WHERE user_id=? and openid=? `
+	sql := `UPDATE user_record SET nick_name=?,headimgurl=?,sex=?,city=?,province=?,country=? WHERE user_id=? and open_id=? `
 	_, err = o.Raw(sql, nickName, headimgUrl, sex, city, province, country, userId, openId).Exec()
 	return
 }