正在显示
7 个修改的文件
包含
27 行增加
和
20 行删除
@@ -197,7 +197,10 @@ func (c *RbacController) MenuList() { | @@ -197,7 +197,10 @@ func (c *RbacController) MenuList() { | ||
197 | c.ResposeJson(msg) | 197 | c.ResposeJson(msg) |
198 | }() | 198 | }() |
199 | list, err := serverbac.GetMenuAll() | 199 | list, err := serverbac.GetMenuAll() |
200 | - msg = protocol.NewReturnResponse(list, err) | 200 | + data := protocol.ResponsePermissionList{ |
201 | + Lists: list, | ||
202 | + } | ||
203 | + msg = protocol.NewReturnResponse(data, err) | ||
201 | return | 204 | return |
202 | } | 205 | } |
203 | 206 |
@@ -70,6 +70,7 @@ var AuthToken = func(ctx *context.Context) { | @@ -70,6 +70,7 @@ var AuthToken = func(ctx *context.Context) { | ||
70 | ctx.Output.JSON(msg, false, false) | 70 | ctx.Output.JSON(msg, false, false) |
71 | return | 71 | return |
72 | } | 72 | } |
73 | + log.Error("token 校验失败") | ||
73 | msg = protocol.NewMesage("1") | 74 | msg = protocol.NewMesage("1") |
74 | ctx.Output.JSON(msg, false, false) | 75 | ctx.Output.JSON(msg, false, false) |
75 | return | 76 | return |
@@ -19,23 +19,23 @@ type BulletinReleaseRequest struct { | @@ -19,23 +19,23 @@ type BulletinReleaseRequest struct { | ||
19 | AllowClose int `json:"allow_close"` | 19 | AllowClose int `json:"allow_close"` |
20 | //AllowCondition int `json:"allow_condition"` | 20 | //AllowCondition int `json:"allow_condition"` |
21 | QuestionSwitch int `json:"question_switch"` | 21 | QuestionSwitch int `json:"question_switch"` |
22 | - Receiver []VisibleObject `json:"receiver" valid:"Required"` | 22 | + Receiver []VisibleObject `json:"receiver"` |
23 | Question Question `json:"question"` | 23 | Question Question `json:"question"` |
24 | - Cover Cover `json:"cover" valid:"Required"` | 24 | + Cover Cover `json:"cover"` |
25 | IsPublish int `json:"is_publish"` //是否直接发布 0:否 1:直接发布 | 25 | IsPublish int `json:"is_publish"` //是否直接发布 0:否 1:直接发布 |
26 | } | 26 | } |
27 | type Question struct { | 27 | type Question struct { |
28 | Id int `json:"id"` | 28 | Id int `json:"id"` |
29 | - Type int `json:"type" valid:"Required"` | ||
30 | - Title string `json:"title" valid:"Required"` | 29 | + Type int `json:"type"` |
30 | + Title string `json:"title" ` | ||
31 | Content []QuestionContent `json:"content" valid:"Required"` | 31 | Content []QuestionContent `json:"content" valid:"Required"` |
32 | } | 32 | } |
33 | type QuestionContent struct { | 33 | type QuestionContent struct { |
34 | - Id int `json:"id" valid:"Required"` | ||
35 | - Content string `json:"content" valid:"Required"` | 34 | + Id int `json:"id"` |
35 | + Content string `json:"content"` | ||
36 | } | 36 | } |
37 | type Cover struct { | 37 | type Cover struct { |
38 | - Path string `json:"path" valid:"Required"` | 38 | + Path string `json:"path"` |
39 | H int `json:"h"` | 39 | H int `json:"h"` |
40 | W int `json:"w"` | 40 | W int `json:"w"` |
41 | } | 41 | } |
@@ -65,9 +65,12 @@ type PermissionItem struct { | @@ -65,9 +65,12 @@ type PermissionItem struct { | ||
65 | ParentId int64 `json:"parent_id"` | 65 | ParentId int64 `json:"parent_id"` |
66 | SeniorStatus int8 `json:"senior_status"` | 66 | SeniorStatus int8 `json:"senior_status"` |
67 | Sort int `json:"sort"` | 67 | Sort int `json:"sort"` |
68 | + Code string `json:"code"` | ||
68 | } | 69 | } |
69 | 70 | ||
70 | -//TODO PermissionItem 实现排序接口 | 71 | +type ResponsePermissionList struct { |
72 | + Lists []PermissionItem `json:"lists"` | ||
73 | +} | ||
71 | 74 | ||
72 | // | 75 | // |
73 | type ResponseRoleMenus struct { | 76 | type ResponseRoleMenus struct { |
@@ -19,19 +19,19 @@ var routerPermission = map[string]PermissionBase{ | @@ -19,19 +19,19 @@ var routerPermission = map[string]PermissionBase{ | ||
19 | } | 19 | } |
20 | 20 | ||
21 | //PermissionWithPosition 职位管理相关 | 21 | //PermissionWithPosition 职位管理相关 |
22 | -type PermissionWithPosition struct { | ||
23 | - PermissionBase | ||
24 | -} | 22 | +// type PermissionWithPosition struct { |
23 | +// PermissionBase | ||
24 | +// } | ||
25 | 25 | ||
26 | //GetCode 模块标识 | 26 | //GetCode 模块标识 |
27 | -func (c *PermissionWithPosition) GetCodeName() string { | ||
28 | - return "OPPMG_DEPARTMENT" | ||
29 | -} | 27 | +// func (c *PermissionWithPosition) GetCodeName() string { |
28 | +// return "OPPMG_DEPARTMENT" | ||
29 | +// } | ||
30 | 30 | ||
31 | //Valid 权限校验 | 31 | //Valid 权限校验 |
32 | -func (c PermissionWithPosition) Valid(userCompanyID int64) bool { | ||
33 | - return true | ||
34 | -} | 32 | +// func (c PermissionWithPosition) Valid(userCompanyID int64) bool { |
33 | +// return true | ||
34 | +// } | ||
35 | 35 | ||
36 | //PermissionWithDepart 部门管理相关 | 36 | //PermissionWithDepart 部门管理相关 |
37 | // type PermissionWithDepart struct { | 37 | // type PermissionWithDepart struct { |
@@ -82,7 +82,7 @@ func init() { | @@ -82,7 +82,7 @@ func init() { | ||
82 | nsUcenter := beego.NewNamespace("/ucenter", | 82 | nsUcenter := beego.NewNamespace("/ucenter", |
83 | beego.NSBefore(middleware.LogRequestData), | 83 | beego.NSBefore(middleware.LogRequestData), |
84 | beego.NSRouter("/company", &controllers.CompanyController{}, "post:InitCompany"), | 84 | beego.NSRouter("/company", &controllers.CompanyController{}, "post:InitCompany"), |
85 | - // beego.NSRouter("/company/info", &controllers.CompanyController{}, ""), | 85 | + beego.NSRouter("/company/info", &controllers.CompanyController{}, "post:GetCompanyForUCenter"), |
86 | ) | 86 | ) |
87 | beego.AddNamespace(nsV1) | 87 | beego.AddNamespace(nsV1) |
88 | beego.AddNamespace(nsAuth) | 88 | beego.AddNamespace(nsAuth) |
@@ -9,7 +9,7 @@ import ( | @@ -9,7 +9,7 @@ import ( | ||
9 | 9 | ||
10 | //获取全部的权限菜单 | 10 | //获取全部的权限菜单 |
11 | func GetMenuAll() ([]protocol.PermissionItem, error) { | 11 | func GetMenuAll() ([]protocol.PermissionItem, error) { |
12 | - const datasql string = `SELECT id,name,icon,parent_id,senior_status,sort | 12 | + const datasql string = `SELECT id,name,icon,parent_id,senior_status,sort,code |
13 | FROM menu WHERE enabled=1 ORDER BY sort ` | 13 | FROM menu WHERE enabled=1 ORDER BY sort ` |
14 | var ( | 14 | var ( |
15 | list []protocol.PermissionItem | 15 | list []protocol.PermissionItem |
-
请 注册 或 登录 后发表评论