|
@@ -122,14 +122,6 @@ func (this *WechatCommonController) WechatLoginByGzh() {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if mfyxUserRecord == nil {
|
|
|
- _, err = models.AddMfyxGzhUserRecord(items)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "获取用户信息失败"
|
|
|
- br.ErrMsg = "添加openid失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
userRecord := &models.UserRecord{
|
|
|
OpenId: openId,
|
|
|
UnionId: unionId,
|
|
@@ -145,10 +137,19 @@ func (this *WechatCommonController) WechatLoginByGzh() {
|
|
|
CreatePlatform: 12,
|
|
|
SessionKey: wxUserInfo.SessionKey,
|
|
|
}
|
|
|
- _, err = models.AddUserRecord(userRecord)
|
|
|
- if err != nil {
|
|
|
- return
|
|
|
+ if mfyxUserRecord == nil {
|
|
|
+ _, err = models.AddMfyxGzhUserRecord(items)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取用户信息失败"
|
|
|
+ br.ErrMsg = "添加openid失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ _, err = models.AddUserRecord(userRecord)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
timeUnix := time.Now().Unix()
|
|
|
timeUnixStr := strconv.FormatInt(timeUnix, 10)
|
|
|
|