作者 yangfu

增加部门用户列表

... ... @@ -25,7 +25,7 @@ func (userService *UserService) SearchUser(cmd *query.ListUserQuery) (int64, int
if err != nil {
return 0, nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
var users []dto.UserBaseDto
var users = make([]dto.UserBaseDto, 0)
for i := range result.Users {
item := &dto.UserBaseDto{}
item.LoadDto(result.Users[i])
... ...
package middleware
import (
"fmt"
"net/http"
"net/url"
... ... @@ -64,10 +65,11 @@ func CheckAccessToken() web.FilterFunc {
}, false, false)
}
}()
//log.Logger.Debug(tokenStr)
tk := &domain.LoginToken{}
err = tk.ParseToken(tokenStr)
if err != nil {
fmt.Println(fmt.Sprintf("token:%v|", tokenStr))
log.Logger.Error(err.Error())
return
}
... ...
... ... @@ -45,6 +45,11 @@ func RedirectInternalService(prefix string, svr internalService) web.FilterFunc
if ok && loginToken.CompanyId > 0 && loginToken.OrgId > 0 {
req.Header("companyId", fmt.Sprintf("%v", loginToken.CompanyId))
req.Header("orgId", fmt.Sprintf("%v", loginToken.OrgId))
orgIdList := make([]string, 0)
for i := range loginToken.OrgIds {
orgIdList = append(orgIdList, fmt.Sprintf("%d", loginToken.OrgIds[i]))
}
req.Header("orgIds", fmt.Sprintf("%v", strings.Join(orgIdList, ",")))
}
req.Body(ctx.Input.RequestBody)
... ...
... ... @@ -28,6 +28,7 @@ func init() {
web.Router("/v1/user/cooperation-org", &mobile_client.UserController{}, "Post:CooperationOrg")
// 特殊处理
web.Router("/v1/user/department-users", &mobile_client.UserController{}, "Post:DepartmentUsers") //公用的
web.Router("/v1/app/orgs/department-users", &mobile_client.UserController{}, "Post:DepartmentUsers")
web.Router("/v1/web/orgs/department-users", &web_client.OrgController{}, "Post:DepartmentUsers")
}
... ...