作者 yangfu

增加部门用户列表

@@ -25,7 +25,7 @@ func (userService *UserService) SearchUser(cmd *query.ListUserQuery) (int64, int @@ -25,7 +25,7 @@ func (userService *UserService) SearchUser(cmd *query.ListUserQuery) (int64, int
25 if err != nil { 25 if err != nil {
26 return 0, nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 26 return 0, nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
27 } 27 }
28 - var users []dto.UserBaseDto 28 + var users = make([]dto.UserBaseDto, 0)
29 for i := range result.Users { 29 for i := range result.Users {
30 item := &dto.UserBaseDto{} 30 item := &dto.UserBaseDto{}
31 item.LoadDto(result.Users[i]) 31 item.LoadDto(result.Users[i])
1 package middleware 1 package middleware
2 2
3 import ( 3 import (
  4 + "fmt"
4 "net/http" 5 "net/http"
5 "net/url" 6 "net/url"
6 7
@@ -64,10 +65,11 @@ func CheckAccessToken() web.FilterFunc { @@ -64,10 +65,11 @@ func CheckAccessToken() web.FilterFunc {
64 }, false, false) 65 }, false, false)
65 } 66 }
66 }() 67 }()
67 - 68 + //log.Logger.Debug(tokenStr)
68 tk := &domain.LoginToken{} 69 tk := &domain.LoginToken{}
69 err = tk.ParseToken(tokenStr) 70 err = tk.ParseToken(tokenStr)
70 if err != nil { 71 if err != nil {
  72 + fmt.Println(fmt.Sprintf("token:%v|", tokenStr))
71 log.Logger.Error(err.Error()) 73 log.Logger.Error(err.Error())
72 return 74 return
73 } 75 }
@@ -45,6 +45,11 @@ func RedirectInternalService(prefix string, svr internalService) web.FilterFunc @@ -45,6 +45,11 @@ func RedirectInternalService(prefix string, svr internalService) web.FilterFunc
45 if ok && loginToken.CompanyId > 0 && loginToken.OrgId > 0 { 45 if ok && loginToken.CompanyId > 0 && loginToken.OrgId > 0 {
46 req.Header("companyId", fmt.Sprintf("%v", loginToken.CompanyId)) 46 req.Header("companyId", fmt.Sprintf("%v", loginToken.CompanyId))
47 req.Header("orgId", fmt.Sprintf("%v", loginToken.OrgId)) 47 req.Header("orgId", fmt.Sprintf("%v", loginToken.OrgId))
  48 + orgIdList := make([]string, 0)
  49 + for i := range loginToken.OrgIds {
  50 + orgIdList = append(orgIdList, fmt.Sprintf("%d", loginToken.OrgIds[i]))
  51 + }
  52 + req.Header("orgIds", fmt.Sprintf("%v", strings.Join(orgIdList, ",")))
48 } 53 }
49 54
50 req.Body(ctx.Input.RequestBody) 55 req.Body(ctx.Input.RequestBody)
@@ -28,6 +28,7 @@ func init() { @@ -28,6 +28,7 @@ func init() {
28 web.Router("/v1/user/cooperation-org", &mobile_client.UserController{}, "Post:CooperationOrg") 28 web.Router("/v1/user/cooperation-org", &mobile_client.UserController{}, "Post:CooperationOrg")
29 29
30 // 特殊处理 30 // 特殊处理
  31 + web.Router("/v1/user/department-users", &mobile_client.UserController{}, "Post:DepartmentUsers") //公用的
31 web.Router("/v1/app/orgs/department-users", &mobile_client.UserController{}, "Post:DepartmentUsers") 32 web.Router("/v1/app/orgs/department-users", &mobile_client.UserController{}, "Post:DepartmentUsers")
32 web.Router("/v1/web/orgs/department-users", &web_client.OrgController{}, "Post:DepartmentUsers") 33 web.Router("/v1/web/orgs/department-users", &web_client.OrgController{}, "Post:DepartmentUsers")
33 } 34 }