正在显示
2 个修改的文件
包含
43 行增加
和
0 行删除
@@ -155,6 +155,7 @@ func (service UsersService) buildUserPofile(userData domain.Users, permissionLis | @@ -155,6 +155,7 @@ func (service UsersService) buildUserPofile(userData domain.Users, permissionLis | ||
155 | } | 155 | } |
156 | if userData.IsSuperAdmin() { | 156 | if userData.IsSuperAdmin() { |
157 | m["status"] = 1 | 157 | m["status"] = 1 |
158 | + menus = append(menus, m) | ||
158 | continue | 159 | continue |
159 | } | 160 | } |
160 | for _, p := range userData.Permission { | 161 | for _, p := range userData.Permission { |
1 | +package controllers | ||
2 | + | ||
3 | +import ( | ||
4 | + "errors" | ||
5 | + | ||
6 | + "github.com/astaxie/beego/logs" | ||
7 | + "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/domain" | ||
8 | +) | ||
9 | + | ||
10 | +type CompanyController struct { | ||
11 | + BaseController | ||
12 | +} | ||
13 | + | ||
14 | +//Prepare 重写 BaseController 的Prepare方法 | ||
15 | +func (c *CompanyController) Prepare() { | ||
16 | + c.BaseController.Prepare() | ||
17 | + if ok := c.ValidJWTToken(); !ok { | ||
18 | + return | ||
19 | + } | ||
20 | + if ok := c.ValidAdminPermission(domain.PERMINSSION_ADMIN_USER); !ok { | ||
21 | + return | ||
22 | + } | ||
23 | +} | ||
24 | + | ||
25 | +func (c *CompanyController) SetPhone() { | ||
26 | + //用与适配前端定义的数据结构 | ||
27 | + type Paramter struct { | ||
28 | + Type int `json:"type"` | ||
29 | + Phone string `json:"phone"` | ||
30 | + } | ||
31 | + var ( | ||
32 | + param Paramter | ||
33 | + err error | ||
34 | + ) | ||
35 | + if err = c.BindJsonData(¶m); err != nil { | ||
36 | + logs.Error(err) | ||
37 | + c.ResponseError(errors.New("json数据解析失败")) | ||
38 | + return | ||
39 | + } | ||
40 | + c.ResponseData(nil) | ||
41 | + return | ||
42 | +} |
-
请 注册 或 登录 后发表评论