|
@@ -107,6 +107,8 @@ func (this *WechatCommonController) WechatLoginByGzh() {
|
|
|
items.Country = wxUserInfo.Country
|
|
|
items.Headimgurl = wxUserInfo.Headimgurl
|
|
|
items.CreateTime = time.Now()
|
|
|
+ items.Subscribe = 1
|
|
|
+ items.SubscribeTime = time.Now()
|
|
|
if user != nil {
|
|
|
items.CygxUserId = user.UserId
|
|
|
items.CygxBindAccount = user.Mobile
|
|
@@ -119,6 +121,25 @@ func (this *WechatCommonController) WechatLoginByGzh() {
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
+ userRecord := &models.UserRecord{
|
|
|
+ OpenId: openId, //用户open_id
|
|
|
+ UnionId: unionId, //用户union_id
|
|
|
+ Subscribe: 0,
|
|
|
+ NickName: wxUserInfo.Nickname, //用户昵称,最大长度:32
|
|
|
+ RealName: "", //用户实际名称,最大长度:32
|
|
|
+ Sex: wxUserInfo.Sex, //普通用户性别,1为男性,2为女性
|
|
|
+ Province: wxUserInfo.Province, //普通用户个人资料填写的省份,最大长度:30
|
|
|
+ City: wxUserInfo.City, //普通用户个人资料填写的城市,最大长度:30
|
|
|
+ Country: wxUserInfo.Country, //国家,如中国为CN,最大长度:30
|
|
|
+ Headimgurl: wxUserInfo.Headimgurl, //用户第三方(微信)头像,最大长度:512
|
|
|
+ CreateTime: time.Now(), //创建时间,关系添加时间、用户授权时间
|
|
|
+ CreatePlatform: 12, //注册平台,1:日度点评公众号,2:管理后台,3:pc端网站,4:查研观向小程序;默认:1
|
|
|
+ SessionKey: wxUserInfo.SessionKey, //微信小程序会话密钥,最大长度:255
|
|
|
+ }
|
|
|
+ _, err = models.AddUserRecord(userRecord)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
timeUnix := time.Now().Unix()
|
|
|
timeUnixStr := strconv.FormatInt(timeUnix, 10)
|
|
|
|