路由组鉴权优化
This commit is contained in:
@@ -24,25 +24,30 @@ func Routers() *gin.Engine {
|
||||
Router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
|
||||
global.GVA_LOG.Info("register swagger handler")
|
||||
// 方便统一添加路由组前缀 多服务器上线使用
|
||||
ApiGroup := Router.Group("")
|
||||
router.InitUserRouter(ApiGroup) // 注册用户路由
|
||||
router.InitBaseRouter(ApiGroup) // 注册基础功能路由 不做鉴权
|
||||
router.InitMenuRouter(ApiGroup) // 注册menu路由
|
||||
router.InitAuthorityRouter(ApiGroup) // 注册角色路由
|
||||
router.InitApiRouter(ApiGroup) // 注册功能api路由
|
||||
router.InitFileUploadAndDownloadRouter(ApiGroup) // 文件上传下载功能路由
|
||||
router.InitSimpleUploaderRouter(ApiGroup) // 断点续传(插件版)
|
||||
router.InitWorkflowRouter(ApiGroup) // 工作流相关路由
|
||||
router.InitCasbinRouter(ApiGroup) // 权限相关路由
|
||||
router.InitJwtRouter(ApiGroup) // jwt相关路由
|
||||
router.InitSystemRouter(ApiGroup) // system相关路由
|
||||
router.InitCustomerRouter(ApiGroup) // 客户路由
|
||||
router.InitAutoCodeRouter(ApiGroup) // 创建自动化代码
|
||||
router.InitSysDictionaryDetailRouter(ApiGroup) // 字典详情管理
|
||||
router.InitSysDictionaryRouter(ApiGroup) // 字典管理
|
||||
router.InitSysOperationRecordRouter(ApiGroup) // 操作记录
|
||||
router.InitEmailRouter(ApiGroup) // 邮件相关路由
|
||||
|
||||
PublicGroup := Router.Group("")
|
||||
{
|
||||
router.InitBaseRouter(PublicGroup) // 注册基础功能路由 不做鉴权
|
||||
}
|
||||
PrivateGroup := Router.Group("")
|
||||
PrivateGroup.Use(middleware.JWTAuth()).Use(middleware.CasbinHandler()).Use(middleware.OperationRecord())
|
||||
{
|
||||
router.InitApiRouter(PrivateGroup) // 注册功能api路由
|
||||
router.InitJwtRouter(PrivateGroup) // jwt相关路由
|
||||
router.InitUserRouter(PrivateGroup) // 注册用户路由
|
||||
router.InitMenuRouter(PrivateGroup) // 注册menu路由
|
||||
router.InitEmailRouter(PrivateGroup) // 邮件相关路由
|
||||
router.InitSystemRouter(PrivateGroup) // system相关路由
|
||||
router.InitCasbinRouter(PrivateGroup) // 权限相关路由
|
||||
router.InitWorkflowRouter(PrivateGroup) // 工作流相关路由
|
||||
router.InitCustomerRouter(PrivateGroup) // 客户路由
|
||||
router.InitAutoCodeRouter(PrivateGroup) // 创建自动化代码
|
||||
router.InitAuthorityRouter(PrivateGroup) // 注册角色路由
|
||||
router.InitSimpleUploaderRouter(PrivateGroup) // 断点续传(插件版)
|
||||
router.InitSysDictionaryRouter(PrivateGroup) // 字典管理
|
||||
router.InitSysOperationRecordRouter(PrivateGroup) // 操作记录
|
||||
router.InitSysDictionaryDetailRouter(PrivateGroup) // 字典详情管理
|
||||
router.InitFileUploadAndDownloadRouter(PrivateGroup) // 文件上传下载功能路由
|
||||
}
|
||||
global.GVA_LOG.Info("router register success")
|
||||
return Router
|
||||
}
|
||||
|
Reference in New Issue
Block a user