...
|
...
|
@@ -351,11 +351,13 @@ func CenterCompanys(header *protocol.RequestHeader, request *protocolx.CenterCom |
|
|
break
|
|
|
case protocol.LoginByCredentials:
|
|
|
//凭证是否存在
|
|
|
if constant.DISENABLE_MULTI_DEVICE_LOGIN {
|
|
|
if credential, e := userAuth.NewRedisUserCredential(request.Phone).GetAuth(); e != nil || !strings.EqualFold(credential, request.Credentials) {
|
|
|
log.Debug("凭证过期或者已失效:", request.Phone)
|
|
|
err = protocol.NewErrWithMessage(4140, err)
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
if _, err = utils.ParseJWTToken(request.Credentials); err != nil {
|
|
|
err = protocol.NewErrWithMessage(4140, err)
|
|
|
return
|
...
|
...
|
@@ -419,11 +421,13 @@ func Companys(header *protocol.RequestHeader, request *protocolx.CompanysRequest |
|
|
return
|
|
|
}
|
|
|
//凭证是否存在
|
|
|
if constant.DISENABLE_MULTI_DEVICE_LOGIN {
|
|
|
if credential, e := userAuth.NewRedisUserCredential(claim.Phone).GetAuth(); e != nil || !strings.EqualFold(credential, request.Credentials) {
|
|
|
log.Debug("凭证过期或者已失效:", claim.Phone)
|
|
|
err = protocol.NewErrWithMessage(4140, err)
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
loginSvr.Init(claim.Phone)
|
|
|
rsp.Partner, _ = loginSvr.PartnerStaticInfo()
|
|
|
rsp.Manager, _ = loginSvr.ManagerStaticInfo()
|
...
|
...
|
@@ -458,12 +462,14 @@ func LoginV2(header *protocol.RequestHeader, request *protocol.LoginRequestV2) ( |
|
|
err = protocol.NewErrWithMessage(4140, err)
|
|
|
return
|
|
|
}
|
|
|
if constant.DISENABLE_MULTI_DEVICE_LOGIN {
|
|
|
//凭证是否存在
|
|
|
if credential, e := userAuth.NewRedisUserCredential(claim.Phone).GetAuth(); e != nil || !strings.EqualFold(credential, request.Credentials) {
|
|
|
log.Debug("凭证过期或者已失效:", claim.Phone)
|
|
|
err = protocol.NewErrWithMessage(4140, err)
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
if company, e := CompanyRepository.FindOne(map[string]interface{}{"id": request.Cid, "enable": 1}); e != nil || company == nil {
|
|
|
err = protocol.NewErrWithMessage(10007, err)
|
|
|
return
|
...
|
...
|
|