|
@@ -284,7 +284,7 @@ func CenterCompanys(header *protocol.RequestHeader, request *protocolx.CenterCom |
|
@@ -284,7 +284,7 @@ func CenterCompanys(header *protocol.RequestHeader, request *protocolx.CenterCom |
284
|
}()
|
284
|
}()
|
285
|
loginSvr.Init(request.Phone)
|
285
|
loginSvr.Init(request.Phone)
|
286
|
if len(loginSvr.Users) == 0 && len(loginSvr.PartnerInfo) == 0 {
|
286
|
if len(loginSvr.Users) == 0 && len(loginSvr.PartnerInfo) == 0 {
|
287
|
- err = protocol.NewErrWithMessage(502, err) //账号不存在
|
287
|
+ err = protocol.NewErrWithMessage(10008)
|
288
|
return
|
288
|
return
|
289
|
}
|
289
|
}
|
290
|
switch request.GrantType {
|
290
|
switch request.GrantType {
|
|
@@ -409,6 +409,17 @@ func LoginV2(header *protocol.RequestHeader, request *protocol.LoginRequestV2) ( |
|
@@ -409,6 +409,17 @@ func LoginV2(header *protocol.RequestHeader, request *protocol.LoginRequestV2) ( |
409
|
return
|
409
|
return
|
410
|
}
|
410
|
}
|
411
|
}
|
411
|
}
|
|
|
412
|
+ //TODO:验证公司模块权限
|
|
|
413
|
+ if _, adminUsers, e := UsersRepository.Find(map[string]interface{}{"inCompanyIds": []int64{int64(request.Cid)}, "adminType": 2}); e == nil {
|
|
|
414
|
+ if len(adminUsers) > 0 {
|
|
|
415
|
+ au := adminUsers[0]
|
|
|
416
|
+ if code, e := adminApiGateway.UserAuth(au.Id, constant.BUSINESS_ADMIN_PLATFORM_ID); e != nil || code != 0 {
|
|
|
417
|
+ log.Debug("【合伙人检查权限】", claim.Phone, "【公司】", request.Cid, au.Id, code, e.Error())
|
|
|
418
|
+ err = protocol.NewErrWithMessage(10008, err) // 抱歉,企业管理员未帮您开通权限
|
|
|
419
|
+ return
|
|
|
420
|
+ }
|
|
|
421
|
+ }
|
|
|
422
|
+ }
|
412
|
break
|
423
|
break
|
413
|
case int(protocolx.AdminTypeManager):
|
424
|
case int(protocolx.AdminTypeManager):
|
414
|
if p, e := UsersRepository.FindOne(map[string]interface{}{"phone": claim.Phone, "companyId": request.Cid}); e == nil {
|
425
|
if p, e := UsersRepository.FindOne(map[string]interface{}{"phone": claim.Phone, "companyId": request.Cid}); e == nil {
|