|
@@ -60,7 +60,7 @@ func (this *WechatCommonController) WechatLogin() {
|
|
|
return
|
|
|
}
|
|
|
//获取用户信息
|
|
|
- wxUserInfo, err := services.WxGetUserInfo(openId,accessToken)
|
|
|
+ wxUserInfo, err := services.WxGetUserInfo(openId, accessToken)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取用户信息失败"
|
|
|
br.ErrMsg = "获取微信用户信息失败,Err:" + err.Error()
|
|
@@ -76,6 +76,7 @@ func (this *WechatCommonController) WechatLogin() {
|
|
|
user.CompanyId = 1
|
|
|
user.CreatedTime = time.Now()
|
|
|
user.UnionId = wxUserInfo.Unionid
|
|
|
+ user.Unionid = wxUserInfo.Unionid
|
|
|
user.Subscribe = wxUserInfo.SubscribeScene
|
|
|
user.SubscribeTime = wxUserInfo.SubscribeTime
|
|
|
user.NickName = wxUserInfo.Nickname
|
|
@@ -86,6 +87,7 @@ func (this *WechatCommonController) WechatLogin() {
|
|
|
user.Headimgurl = wxUserInfo.Headimgurl
|
|
|
user.Remark = wxUserInfo.Remark
|
|
|
user.FirstLogin = 1
|
|
|
+ user.Enabled = 1
|
|
|
err = models.AddWxUser(user)
|
|
|
if wxUserInfo.Unionid != "" {
|
|
|
wxUser, err = models.GetWxUserItemByUnionid(wxUserInfo.Unionid)
|
|
@@ -198,4 +200,4 @@ func (this *WechatController) GetWxSign() {
|
|
|
|
|
|
/*
|
|
|
$app->bag('api/wechat/check', "WechatController@check");
|
|
|
-*/
|
|
|
+*/
|