作者 唐旭辉

修复

... ... @@ -155,6 +155,7 @@ func (service UsersService) buildUserPofile(userData domain.Users, permissionLis
}
if userData.IsSuperAdmin() {
m["status"] = 1
menus = append(menus, m)
continue
}
for _, p := range userData.Permission {
... ...
package controllers
import (
"errors"
"github.com/astaxie/beego/logs"
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/domain"
)
type CompanyController struct {
BaseController
}
//Prepare 重写 BaseController 的Prepare方法
func (c *CompanyController) Prepare() {
c.BaseController.Prepare()
if ok := c.ValidJWTToken(); !ok {
return
}
if ok := c.ValidAdminPermission(domain.PERMINSSION_ADMIN_USER); !ok {
return
}
}
func (c *CompanyController) SetPhone() {
//用与适配前端定义的数据结构
type Paramter struct {
Type int `json:"type"`
Phone string `json:"phone"`
}
var (
param Paramter
err error
)
if err = c.BindJsonData(&param); err != nil {
logs.Error(err)
c.ResponseError(errors.New("json数据解析失败"))
return
}
c.ResponseData(nil)
return
}
... ...