|
@@ -280,20 +280,18 @@ func UserInfo(header *protocol.RequestHeader, request *protocol.UserInfoRequest) |
|
@@ -280,20 +280,18 @@ func UserInfo(header *protocol.RequestHeader, request *protocol.UserInfoRequest) |
280
|
userAuth *models.UserAuth
|
280
|
userAuth *models.UserAuth
|
281
|
userBaseAgg *protocol.UserBaseInfoAggregation
|
281
|
userBaseAgg *protocol.UserBaseInfoAggregation
|
282
|
companys []*models.Company
|
282
|
companys []*models.Company
|
|
|
283
|
+ userCompanys []*models.UserCompany
|
283
|
)
|
284
|
)
|
284
|
if companys, err = models.GetCompanyByPermission(header.Uid); err != nil {
|
285
|
if companys, err = models.GetCompanyByPermission(header.Uid); err != nil {
|
285
|
log.Error(err)
|
286
|
log.Error(err)
|
286
|
return
|
287
|
return
|
287
|
}
|
288
|
}
|
288
|
-
|
|
|
289
|
- //保证用户登录期间公司有权限
|
|
|
290
|
- //if len(companys) == 0 {
|
|
|
291
|
- // //无权限
|
|
|
292
|
- // err = protocol.NewErrWithMessage(2002)
|
|
|
293
|
- // return
|
|
|
294
|
- //}
|
|
|
295
|
- for i := range companys {
|
|
|
296
|
- if companys[i].Id == header.CompanyId {
|
289
|
+ if userCompanys, err = models.GetUserAllCompany(header.Uid); err != nil {
|
|
|
290
|
+ log.Error(err)
|
|
|
291
|
+ return
|
|
|
292
|
+ }
|
|
|
293
|
+ for i := range userCompanys {
|
|
|
294
|
+ if userCompanys[i].Id == header.UserId && userCompanys[i].CompanyId == header.CompanyId {
|
297
|
companyId = header.CompanyId
|
295
|
companyId = header.CompanyId
|
298
|
break
|
296
|
break
|
299
|
}
|
297
|
}
|