|
@@ -6,7 +6,6 @@ import (
|
|
|
userLogic "hongze/hongze_yb/logic/user"
|
|
|
"hongze/hongze_yb/models/request/user"
|
|
|
userResp "hongze/hongze_yb/models/response/user"
|
|
|
- "hongze/hongze_yb/models/tables/wx_user"
|
|
|
userService "hongze/hongze_yb/services/user"
|
|
|
"hongze/hongze_yb/utils"
|
|
|
"strings"
|
|
@@ -41,7 +40,7 @@ func Login(c *gin.Context) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- var bindAccount string
|
|
|
+ //var bindAccount string
|
|
|
if req.LoginType == 1 {
|
|
|
//手机登录
|
|
|
if req.Mobile == "" {
|
|
@@ -49,7 +48,7 @@ func Login(c *gin.Context) {
|
|
|
return
|
|
|
}
|
|
|
req.Mobile = strings.Trim(req.Mobile, " ")
|
|
|
- bindAccount = req.Mobile
|
|
|
+ //bindAccount = req.Mobile
|
|
|
}
|
|
|
if req.LoginType == 2 {
|
|
|
//邮箱登录
|
|
@@ -61,19 +60,19 @@ func Login(c *gin.Context) {
|
|
|
response.Fail("邮箱格式错误,请重新输入", c)
|
|
|
return
|
|
|
}
|
|
|
- bindAccount = req.Email
|
|
|
+ //bindAccount = req.Email
|
|
|
}
|
|
|
|
|
|
// 校验账号是否已有绑定微信
|
|
|
- bindUser, e := wx_user.GetWxUserBindExist(bindAccount, openId)
|
|
|
- if e != nil && e != utils.ErrNoRow {
|
|
|
- response.FailMsg("登录失败", "获取账号是否已绑定微信失败, Err: "+e.Error(), c)
|
|
|
- return
|
|
|
- }
|
|
|
- if bindUser != nil && bindUser.UserID > 0 {
|
|
|
- response.Fail("登录失败, 该账号已绑定其他微信", c)
|
|
|
- return
|
|
|
- }
|
|
|
+ //bindUser, e := wx_user.GetWxUserBindExist(bindAccount, openId)
|
|
|
+ //if e != nil && e != utils.ErrNoRow {
|
|
|
+ // response.FailMsg("登录失败", "获取账号是否已绑定微信失败, Err: "+e.Error(), c)
|
|
|
+ // return
|
|
|
+ //}
|
|
|
+ //if bindUser != nil && bindUser.UserID > 0 {
|
|
|
+ // response.Fail("登录失败, 该账号已绑定其他微信", c)
|
|
|
+ // return
|
|
|
+ //}
|
|
|
|
|
|
token, newUserInfo, err, errMsg := userService.BindWxUser(openId, req.Mobile, req.Email, req.VerifyCode, req.LoginType, req.AreaNum, 1)
|
|
|
if err != nil {
|