增加判断rbac

pull/30/head
taoshihan1991 4 years ago
parent 56ed90fc82
commit 520b2a5bca

@ -78,8 +78,8 @@ func main() {
//获取客服信息
engine.GET("/kefuinfo",middleware.JwtApiMiddleware, controller.GetKefuInfo)
engine.GET("/kefuinfo_setting",middleware.JwtApiMiddleware, controller.GetKefuInfoSetting)
engine.POST("/kefuinfo",middleware.JwtApiMiddleware,middleware.CasbinACL, controller.PostKefuInfo)
engine.DELETE("/kefuinfo",middleware.JwtApiMiddleware,middleware.CasbinACL, controller.DeleteKefuInfo)
engine.POST("/kefuinfo",middleware.JwtApiMiddleware,middleware.RbacAuth, controller.PostKefuInfo)
engine.DELETE("/kefuinfo",middleware.JwtApiMiddleware,middleware.RbacAuth, controller.DeleteKefuInfo)
engine.GET("/kefulist",middleware.JwtApiMiddleware, controller.GetKefuList)
//设置页
engine.GET("/setting", tmpl.PageSetting)
@ -96,8 +96,8 @@ func main() {
//邮件夹列表
engine.GET("/folders", controller.GetFolders)
engine.GET("/mysql",middleware.JwtApiMiddleware,middleware.CasbinACL, controller.MysqlGetConf)
engine.POST("/mysql",middleware.JwtApiMiddleware,middleware.CasbinACL, controller.MysqlSetConf)
engine.GET("/mysql",middleware.JwtApiMiddleware,middleware.RbacAuth, controller.MysqlGetConf)
engine.POST("/mysql",middleware.JwtApiMiddleware,middleware.RbacAuth, controller.MysqlSetConf)
engine.POST("/visitor",controller.PostVisitor)
engine.GET("/visitor",middleware.JwtApiMiddleware, controller.GetVisitor)
engine.GET("/visitors",middleware.JwtApiMiddleware, controller.GetVisitors)

@ -9,4 +9,9 @@ func FindRoles()[]Role{
var roles []Role
DB.Order("id desc").Find(&roles)
return roles
}
func FindRole(id interface{})Role{
var role Role
DB.Where("id = ?", id).First(&role)
return role
}

@ -14,7 +14,7 @@
}
.kefuFaceBox{
position: absolute;
bottom: 110px;
bottom: 0px;
z-index: 999;
}
.faceBtn {

Loading…
Cancel
Save