增加判断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",middleware.JwtApiMiddleware, controller.GetKefuInfo)
engine.GET("/kefuinfo_setting",middleware.JwtApiMiddleware, controller.GetKefuInfoSetting) engine.GET("/kefuinfo_setting",middleware.JwtApiMiddleware, controller.GetKefuInfoSetting)
engine.POST("/kefuinfo",middleware.JwtApiMiddleware,middleware.CasbinACL, controller.PostKefuInfo) engine.POST("/kefuinfo",middleware.JwtApiMiddleware,middleware.RbacAuth, controller.PostKefuInfo)
engine.DELETE("/kefuinfo",middleware.JwtApiMiddleware,middleware.CasbinACL, controller.DeleteKefuInfo) engine.DELETE("/kefuinfo",middleware.JwtApiMiddleware,middleware.RbacAuth, controller.DeleteKefuInfo)
engine.GET("/kefulist",middleware.JwtApiMiddleware, controller.GetKefuList) engine.GET("/kefulist",middleware.JwtApiMiddleware, controller.GetKefuList)
//设置页 //设置页
engine.GET("/setting", tmpl.PageSetting) engine.GET("/setting", tmpl.PageSetting)
@ -96,8 +96,8 @@ func main() {
//邮件夹列表 //邮件夹列表
engine.GET("/folders", controller.GetFolders) engine.GET("/folders", controller.GetFolders)
engine.GET("/mysql",middleware.JwtApiMiddleware,middleware.CasbinACL, controller.MysqlGetConf) engine.GET("/mysql",middleware.JwtApiMiddleware,middleware.RbacAuth, controller.MysqlGetConf)
engine.POST("/mysql",middleware.JwtApiMiddleware,middleware.CasbinACL, controller.MysqlSetConf) engine.POST("/mysql",middleware.JwtApiMiddleware,middleware.RbacAuth, controller.MysqlSetConf)
engine.POST("/visitor",controller.PostVisitor) engine.POST("/visitor",controller.PostVisitor)
engine.GET("/visitor",middleware.JwtApiMiddleware, controller.GetVisitor) engine.GET("/visitor",middleware.JwtApiMiddleware, controller.GetVisitor)
engine.GET("/visitors",middleware.JwtApiMiddleware, controller.GetVisitors) engine.GET("/visitors",middleware.JwtApiMiddleware, controller.GetVisitors)

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

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

Loading…
Cancel
Save