|
@@ -431,11 +431,9 @@ func (this *UserPcNotAuthController) PcBind() {
|
|
|
return
|
|
|
}
|
|
|
unionId := this.User.UnionId
|
|
|
- userId := this.User.UserId
|
|
|
openId := this.User.OpenId
|
|
|
|
|
|
utils.FileLog.Info("绑定unionId:%s", unionId)
|
|
|
- utils.FileLog.Info("userId:%d", userId)
|
|
|
|
|
|
if req.BindType == 1 {
|
|
|
if req.Mobile == "" {
|
|
@@ -502,14 +500,12 @@ func (this *UserPcNotAuthController) PcBind() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-
|
|
|
user,err := services.BindWxUser(openId,req.Mobile,req.Email)
|
|
|
if err != nil{
|
|
|
br.Msg = "绑定失败:"+err.Error()
|
|
|
return
|
|
|
}
|
|
|
- newUserId := user.UserId
|
|
|
-
|
|
|
+ userId := user.UserId
|
|
|
var token string
|
|
|
tokenItem, err := models.GetTokenByOpenId(openId)
|
|
|
if err != nil && err.Error() != utils.ErrNoRow() {
|
|
@@ -554,7 +550,7 @@ func (this *UserPcNotAuthController) PcBind() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- cp, err := models.GetCompanyProductsByUserId(newUserId)
|
|
|
+ cp, err := models.GetCompanyProductsByUserId(userId)
|
|
|
if err != nil {
|
|
|
br.Msg = "登录失败"
|
|
|
br.ErrMsg = "登录失败,获取客户信息失败:" + err.Error()
|
|
@@ -574,7 +570,7 @@ func (this *UserPcNotAuthController) PcBind() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- newUser, err := models.GetWxUserItemByUserId(newUserId)
|
|
|
+ newUser, err := models.GetWxUserItemByUserId(userId)
|
|
|
if err != nil {
|
|
|
br.Msg = "登录失败"
|
|
|
br.ErrMsg = "获取客户信息失败 GetWxUserItemByUserId:" + err.Error()
|
|
@@ -590,13 +586,13 @@ func (this *UserPcNotAuthController) PcBind() {
|
|
|
loginLog.Email=req.Email
|
|
|
loginLog.UnionId=unionId
|
|
|
loginLog.Handle="pc_bind"
|
|
|
- loginLog.Remark=strconv.Itoa(newUserId)
|
|
|
+ loginLog.Remark=strconv.Itoa(userId)
|
|
|
loginLog.CreateTime = time.Now()
|
|
|
go models.AddWxUserLog(loginLog)
|
|
|
}
|
|
|
|
|
|
resp := new(models.LoginResp)
|
|
|
- resp.UserId = newUserId
|
|
|
+ resp.UserId = userId
|
|
|
resp.UserPermission = userPermission
|
|
|
resp.Authorization = token
|
|
|
resp.Email = newUser.Email
|