作者 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{}{
... ... @@ -388,8 +394,14 @@ func (svr AuthService) getUserInfo(operator domain.Operator) (interface{}, error
"companyName": resultUser.Company.CompanyName,
"logo": resultUser.Company.Log,
},
"im": resultUser.IM,
"org": resultUser.Org,
"im": resultUser.IM,
"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,23 +87,22 @@ type (
}
DataOrgGet struct {
Org struct {
CompanyID int `json:"companyId"`
Ext struct {
DepName string `json:"depName"`
OrgName string `json:"orgName"`
ParentDepName string `json:"parentDepName"`
Phone string `json:"phone"`
UserName string `json:"userName"`
} `json:"ext"`
IsOrg int `json:"isOrg"`
OrgCode string `json:"orgCode"`
OrgID int `json:"orgId"`
OrgName string `json:"orgName"`
OrgStatus int `json:"orgStatus"`
ParentID int `json:"parentId"`
ParentPath string `json:"parentPath"`
} `json:"org"`
CompanyID int `json:"companyId"`
Ext struct {
DepName string `json:"depName"`
OrgName string `json:"orgName"`
ParentDepName string `json:"parentDepName"`
Phone string `json:"phone"`
UserName string `json:"userName"`
} `json:"ext"`
IsOrg int `json:"isOrg"`
OrgCode string `json:"orgCode"`
OrgID int `json:"orgId"`
OrgName string `json:"orgName"`
OrgStatus int `json:"orgStatus"`
ParentID int `json:"parentId"`
ParentPath string `json:"parentPath"`
//} `json:"org"`
}
)
... ...