作者 yangfu

当前登录组织修改

... ... @@ -373,6 +373,12 @@ func (svr AuthService) getUserInfo(operator domain.Operator) (interface{}, error
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
resultOrg, err := creationUserGateway.OrgGet(allied_creation_user.ReqOrgGet{
OrgId: int(operator.OrgId),
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
var user = map[string]interface{}{
"userId": resultUser.UserId,
"userInfo": map[string]interface{}{
... ... @@ -389,7 +395,13 @@ func (svr AuthService) getUserInfo(operator domain.Operator) (interface{}, error
"logo": resultUser.Company.Log,
},
"im": resultUser.IM,
"org": resultUser.Org,
"org": map[string]interface{}{
"orgId": resultOrg.OrgID,
"orgName": resultOrg.OrgName,
"orgCode": resultOrg.OrgCode,
"companyId": resultOrg.CompanyID,
},
//"currentLoginOrg":resultUser.Org,
}
return user, nil
}
... ...
... ... @@ -66,12 +66,12 @@ func (orgsService *OrgsService) OrgGet(orgGetQuery *query.OrgGetQuery) (interfac
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
data := dto.OrgItem{
OrgId: strconv.Itoa(result.Org.OrgID),
OrgName: result.Org.OrgName,
ParentId: strconv.Itoa(result.Org.ParentID),
IsOrg: result.Org.IsOrg,
OrgCode: result.Org.OrgCode,
ParentDepName: result.Org.Ext.ParentDepName,
OrgId: strconv.Itoa(result.OrgID),
OrgName: result.OrgName,
ParentId: strconv.Itoa(result.ParentID),
IsOrg: result.IsOrg,
OrgCode: result.OrgCode,
ParentDepName: result.Ext.ParentDepName,
}
return data, nil
}
... ...
... ... @@ -87,7 +87,6 @@ type (
}
DataOrgGet struct {
Org struct {
CompanyID int `json:"companyId"`
Ext struct {
DepName string `json:"depName"`
... ... @@ -103,7 +102,7 @@ type (
OrgStatus int `json:"orgStatus"`
ParentID int `json:"parentId"`
ParentPath string `json:"parentPath"`
} `json:"org"`
//} `json:"org"`
}
)
... ...