|
@@ -2,6 +2,7 @@ package domain_service |
|
@@ -2,6 +2,7 @@ package domain_service |
2
|
|
2
|
|
3
|
import (
|
3
|
import (
|
4
|
"github.com/tiptok/gocomm/xa/eda"
|
4
|
"github.com/tiptok/gocomm/xa/eda"
|
|
|
5
|
+ "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/constant"
|
5
|
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/domain"
|
6
|
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/domain"
|
6
|
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/dao"
|
7
|
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/dao"
|
7
|
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/pg/transaction"
|
8
|
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/pg/transaction"
|
|
@@ -154,8 +155,8 @@ func (svr *PgLoginService) ManagerStaticInfo() (interface{}, error) { |
|
@@ -154,8 +155,8 @@ func (svr *PgLoginService) ManagerStaticInfo() (interface{}, error) { |
154
|
return response, nil
|
155
|
return response, nil
|
155
|
}
|
156
|
}
|
156
|
var (
|
157
|
var (
|
157
|
- companyList []*domain.Company
|
|
|
158
|
- //adminApiGateway = http_gateway.NewHttplibBusinessAdminApiServiceGateway()
|
158
|
+ companyList []*domain.Company
|
|
|
159
|
+ adminApiGateway = http_gateway.NewHttplibBusinessAdminApiServiceGateway()
|
159
|
)
|
160
|
)
|
160
|
doGetCompanyIds := func() []int64 {
|
161
|
doGetCompanyIds := func() []int64 {
|
161
|
var companies []int64
|
162
|
var companies []int64
|
|
@@ -169,22 +170,24 @@ func (svr *PgLoginService) ManagerStaticInfo() (interface{}, error) { |
|
@@ -169,22 +170,24 @@ func (svr *PgLoginService) ManagerStaticInfo() (interface{}, error) { |
169
|
for i := range companyList {
|
170
|
for i := range companyList {
|
170
|
c := companyList[i]
|
171
|
c := companyList[i]
|
171
|
|
172
|
|
172
|
- //通过企业平台 校验模块权限
|
|
|
173
|
- //var user *domain.Users
|
|
|
174
|
- //for j := range svr.Users {
|
|
|
175
|
- // if svr.Users[j].CompanyId == c.Id {
|
|
|
176
|
- // user = svr.Users[j]
|
|
|
177
|
- // break
|
|
|
178
|
- // }
|
|
|
179
|
- //}
|
|
|
180
|
- //if user != nil {
|
|
|
181
|
- // if code, e := adminApiGateway.UserAuth(user.Id, constant.BUSINESS_ADMIN_PLATFORM_ID); e != nil || code != 0 {
|
|
|
182
|
- // log.Debug("【检查权限】", svr.Phone, "【公司】", c.Id, user.Id, code, e.Error())
|
|
|
183
|
- // continue
|
|
|
184
|
- // } else {
|
|
|
185
|
- // log.Debug("【检查权限】", svr.Phone, "【公司】", c.Id, user.Id, code, e)
|
|
|
186
|
- // }
|
|
|
187
|
- //}
|
173
|
+ if constant.POSTGRESQL_DB_NAME != "partner_dev" {
|
|
|
174
|
+ //通过企业平台 校验模块权限
|
|
|
175
|
+ var user *domain.Users
|
|
|
176
|
+ for j := range svr.Users {
|
|
|
177
|
+ if svr.Users[j].CompanyId == c.Id {
|
|
|
178
|
+ user = svr.Users[j]
|
|
|
179
|
+ break
|
|
|
180
|
+ }
|
|
|
181
|
+ }
|
|
|
182
|
+ if user != nil {
|
|
|
183
|
+ if code, e := adminApiGateway.UserAuth(user.Id, constant.BUSINESS_ADMIN_PLATFORM_ID); e != nil || code != 0 {
|
|
|
184
|
+ log.Debug("【检查权限】", svr.Phone, "【公司】", c.Id, user.Id, code, e.Error())
|
|
|
185
|
+ continue
|
|
|
186
|
+ } else {
|
|
|
187
|
+ log.Debug("【检查权限】", svr.Phone, "【公司】", c.Id, user.Id, code, e)
|
|
|
188
|
+ }
|
|
|
189
|
+ }
|
|
|
190
|
+ }
|
188
|
item := newCompanyBase(c)
|
191
|
item := newCompanyBase(c)
|
189
|
companys = append(companys, item)
|
192
|
companys = append(companys, item)
|
190
|
}
|
193
|
}
|