...
|
...
|
@@ -280,20 +280,18 @@ func UserInfo(header *protocol.RequestHeader, request *protocol.UserInfoRequest) |
|
|
userAuth *models.UserAuth
|
|
|
userBaseAgg *protocol.UserBaseInfoAggregation
|
|
|
companys []*models.Company
|
|
|
userCompanys []*models.UserCompany
|
|
|
)
|
|
|
if companys, err = models.GetCompanyByPermission(header.Uid); err != nil {
|
|
|
log.Error(err)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
//保证用户登录期间公司有权限
|
|
|
//if len(companys) == 0 {
|
|
|
// //无权限
|
|
|
// err = protocol.NewErrWithMessage(2002)
|
|
|
// return
|
|
|
//}
|
|
|
for i := range companys {
|
|
|
if companys[i].Id == header.CompanyId {
|
|
|
if userCompanys, err = models.GetUserAllCompany(header.Uid); err != nil {
|
|
|
log.Error(err)
|
|
|
return
|
|
|
}
|
|
|
for i := range userCompanys {
|
|
|
if userCompanys[i].Id == header.UserId && userCompanys[i].CompanyId == header.CompanyId {
|
|
|
companyId = header.CompanyId
|
|
|
break
|
|
|
}
|
...
|
...
|
|