|
@@ -41,6 +41,7 @@ func (this *UserCommonController) Login() {
|
|
|
br.ErrMsg = "参数解析失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+ resp := new(models.LoginResp)
|
|
|
mobile := req.Mobile
|
|
|
req.Mobile = strings.Trim(req.Mobile, " ")
|
|
|
if req.Mobile == "" {
|
|
@@ -61,16 +62,6 @@ func (this *UserCommonController) Login() {
|
|
|
br.ErrMsg = "Password 为空"
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
- total, err := models.GetCygxUserPasswordCountByMobileAdnPss(mobile, password)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "获取信息失败"
|
|
|
- br.ErrMsg = "获取信息失败 GetCygxUserPasswordCountByMobileAdnPss err" + err.Error()
|
|
|
- }
|
|
|
- if total == 0 {
|
|
|
- br.Msg = "密码错误,请重新输入"
|
|
|
- return
|
|
|
- }
|
|
|
userByps, err := models.GetWxUserItemByUserMobile(mobile)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取信息失败"
|
|
@@ -84,6 +75,27 @@ func (this *UserCommonController) Login() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ //专栏作者,但是还没设置登录密码,弹窗提示如下:
|
|
|
+ isSetPassword := services.GetIsSetPassword(mobile)
|
|
|
+ if !isSetPassword {
|
|
|
+ resp.LoginErrCode = 1
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "获取成功"
|
|
|
+ br.Data = resp
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ total, err := models.GetCygxUserPasswordCountByMobileAdnPss(mobile, password)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取信息失败 GetCygxUserPasswordCountByMobileAdnPss err" + err.Error()
|
|
|
+ }
|
|
|
+ if total == 0 {
|
|
|
+ br.Msg = "密码错误,请重新输入"
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
} else {
|
|
|
code := req.VCode
|
|
|
if code == "" {
|
|
@@ -165,7 +177,6 @@ func (this *UserCommonController) Login() {
|
|
|
services.AddInviteCompany(user) //记录通过三方合作机构过来的公司
|
|
|
}
|
|
|
|
|
|
- resp := new(models.LoginResp)
|
|
|
resp.UserId = user.UserId
|
|
|
resp.Headimgurl = user.Headimgurl
|
|
|
resp.Mobile = user.Mobile
|