1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- package routers
- import (
- "eta/eta_mini_crm/controllers"
- beego "github.com/beego/beego/v2/server/web"
- "github.com/beego/beego/v2/server/web/filter/cors"
- )
- func init() {
- beego.InsertFilter("*", beego.BeforeRouter, cors.Allow(&cors.Options{
- AllowAllOrigins: true,
- AllowMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
- AllowHeaders: []string{"Origin", "Authorization", "Uuid", "Accesstoken", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
- ExposeHeaders: []string{"Content-Length", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
- AllowCredentials: true,
- }))
- ns := beego.NewNamespace("/adminapi",
- beego.NSNamespace("/sys_user",
- beego.NSInclude(
- &controllers.UserLoginController{},
- &controllers.SysUserController{},
- ),
- ),
- beego.NSNamespace("/department",
- beego.NSInclude(
- &controllers.SysDepartmentController{},
- ),
- ),
- beego.NSNamespace("/role",
- beego.NSInclude(
- &controllers.SysRoleController{},
- ),
- ),
- beego.NSNamespace("/chart_permission",
- beego.NSInclude(
- &controllers.ChartPermissionController{},
- ),
- ),
- beego.NSNamespace("/user",
- beego.NSInclude(
- &controllers.UserController{},
- ),
- ),
- beego.NSNamespace("/sys_message",
- beego.NSInclude(
- &controllers.SysMessageReportController{},
- ),
- ),
- beego.NSNamespace("/seller",
- beego.NSInclude(
- &controllers.SellerController{},
- ),
- ),
- beego.NSNamespace("/classify",
- beego.NSInclude(
- &controllers.ClassifyController{},
- ),
- ),
- beego.NSNamespace("/read",
- beego.NSInclude(
- &controllers.UserReadRecordController{},
- ),
- ),
- beego.NSNamespace("/report_pdf",
- beego.NSInclude(
- &controllers.ReportPdfController{},
- ),
- ),
- beego.NSNamespace("/report_push",
- beego.NSInclude(
- &controllers.ReportPushStatusController{},
- ),
- ),
- )
- beego.AddNamespace(ns)
- }
|