作者 唐旭辉

添加公告 参数调整

... ... @@ -197,7 +197,10 @@ func (c *RbacController) MenuList() {
c.ResposeJson(msg)
}()
list, err := serverbac.GetMenuAll()
msg = protocol.NewReturnResponse(list, err)
data := protocol.ResponsePermissionList{
Lists: list,
}
msg = protocol.NewReturnResponse(data, err)
return
}
... ...
... ... @@ -70,6 +70,7 @@ var AuthToken = func(ctx *context.Context) {
ctx.Output.JSON(msg, false, false)
return
}
log.Error("token 校验失败")
msg = protocol.NewMesage("1")
ctx.Output.JSON(msg, false, false)
return
... ...
... ... @@ -19,23 +19,23 @@ type BulletinReleaseRequest struct {
AllowClose int `json:"allow_close"`
//AllowCondition int `json:"allow_condition"`
QuestionSwitch int `json:"question_switch"`
Receiver []VisibleObject `json:"receiver" valid:"Required"`
Receiver []VisibleObject `json:"receiver"`
Question Question `json:"question"`
Cover Cover `json:"cover" valid:"Required"`
Cover Cover `json:"cover"`
IsPublish int `json:"is_publish"` //是否直接发布 0:否 1:直接发布
}
type Question struct {
Id int `json:"id"`
Type int `json:"type" valid:"Required"`
Title string `json:"title" valid:"Required"`
Type int `json:"type"`
Title string `json:"title" `
Content []QuestionContent `json:"content" valid:"Required"`
}
type QuestionContent struct {
Id int `json:"id" valid:"Required"`
Content string `json:"content" valid:"Required"`
Id int `json:"id"`
Content string `json:"content"`
}
type Cover struct {
Path string `json:"path" valid:"Required"`
Path string `json:"path"`
H int `json:"h"`
W int `json:"w"`
}
... ...
... ... @@ -65,9 +65,12 @@ type PermissionItem struct {
ParentId int64 `json:"parent_id"`
SeniorStatus int8 `json:"senior_status"`
Sort int `json:"sort"`
Code string `json:"code"`
}
//TODO PermissionItem 实现排序接口
type ResponsePermissionList struct {
Lists []PermissionItem `json:"lists"`
}
//
type ResponseRoleMenus struct {
... ...
... ... @@ -19,19 +19,19 @@ var routerPermission = map[string]PermissionBase{
}
//PermissionWithPosition 职位管理相关
type PermissionWithPosition struct {
PermissionBase
}
// type PermissionWithPosition struct {
// PermissionBase
// }
//GetCode 模块标识
func (c *PermissionWithPosition) GetCodeName() string {
return "OPPMG_DEPARTMENT"
}
// func (c *PermissionWithPosition) GetCodeName() string {
// return "OPPMG_DEPARTMENT"
// }
//Valid 权限校验
func (c PermissionWithPosition) Valid(userCompanyID int64) bool {
return true
}
// func (c PermissionWithPosition) Valid(userCompanyID int64) bool {
// return true
// }
//PermissionWithDepart 部门管理相关
// type PermissionWithDepart struct {
... ...
... ... @@ -82,7 +82,7 @@ func init() {
nsUcenter := beego.NewNamespace("/ucenter",
beego.NSBefore(middleware.LogRequestData),
beego.NSRouter("/company", &controllers.CompanyController{}, "post:InitCompany"),
// beego.NSRouter("/company/info", &controllers.CompanyController{}, ""),
beego.NSRouter("/company/info", &controllers.CompanyController{}, "post:GetCompanyForUCenter"),
)
beego.AddNamespace(nsV1)
beego.AddNamespace(nsAuth)
... ...
... ... @@ -9,7 +9,7 @@ import (
//获取全部的权限菜单
func GetMenuAll() ([]protocol.PermissionItem, error) {
const datasql string = `SELECT id,name,icon,parent_id,senior_status,sort
const datasql string = `SELECT id,name,icon,parent_id,senior_status,sort,code
FROM menu WHERE enabled=1 ORDER BY sort `
var (
list []protocol.PermissionItem
... ...