作者 唐旭辉

修复bug 登录

1 appname = partnermg 1 appname = partnermg
2 -runmode = "${RUN_MODE||test}" 2 +runmode = "${RUN_MODE||dev}"
3 httpport = "${HTTP_PORT||8082}" 3 httpport = "${HTTP_PORT||8082}"
4 4
5 #开启监控 5 #开启监控
@@ -97,7 +97,7 @@ func (reponsitory CompanyRepository) FindOne(queryOptions domain.CompanyFindOneO @@ -97,7 +97,7 @@ func (reponsitory CompanyRepository) FindOne(queryOptions domain.CompanyFindOneO
97 } 97 }
98 if queryOptions.AdminCompanyId > 0 { 98 if queryOptions.AdminCompanyId > 0 {
99 hasCondition = true 99 hasCondition = true
100 - query = query.Where("admin_company_id=?", queryOptions.Id) 100 + query = query.Where("admin_company_id=?", queryOptions.AdminCompanyId)
101 } 101 }
102 if !hasCondition { 102 if !hasCondition {
103 return domain.Company{}, errors.New("findOne 必须要有查询条件") 103 return domain.Company{}, errors.New("findOne 必须要有查询条件")
@@ -21,6 +21,12 @@ func NewMmmBusinessAdminServiceGateway() *MmmBusinessAdminServiceGateway { @@ -21,6 +21,12 @@ func NewMmmBusinessAdminServiceGateway() *MmmBusinessAdminServiceGateway {
21 baseURL: constant.BUSINESS_ADMIN_HOST, 21 baseURL: constant.BUSINESS_ADMIN_HOST,
22 } 22 }
23 } 23 }
  24 +func (client MmmBusinessAdminServiceGateway) buildHeader() http.Header {
  25 + var h = http.Header{}
  26 + h.Set("Content-Type", "application/json")
  27 + h.Set("Accept", "application/json")
  28 + return h
  29 +}
24 30
25 type ResponseGetUserAuth struct { 31 type ResponseGetUserAuth struct {
26 UCenterCommonMsg 32 UCenterCommonMsg
@@ -41,6 +47,7 @@ func (gateway MmmBusinessAdminServiceGateway) httpDo(reqURL string, mathod strin @@ -41,6 +47,7 @@ func (gateway MmmBusinessAdminServiceGateway) httpDo(reqURL string, mathod strin
41 logs.Info("====>Send To URL:%s", reqURL) 47 logs.Info("====>Send To URL:%s", reqURL)
42 logs.Info("====>Send To BusinessAdmin:%s", bt.String()) 48 logs.Info("====>Send To BusinessAdmin:%s", bt.String())
43 req, err := http.NewRequest(mathod, reqURL, bt) 49 req, err := http.NewRequest(mathod, reqURL, bt)
  50 + req.Header = gateway.buildHeader()
44 if err != nil { 51 if err != nil {
45 return nil, err 52 return nil, err
46 } 53 }