123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- package routers
- import (
- "github.com/beego/beego/v2/server/web/filter/cors"
- "hongze/hongze_mobile_admin/controllers"
- "hongze/hongze_mobile_admin/controllers/business_trip"
- "hongze/hongze_mobile_admin/controllers/roadshow"
- "hongze/hongze_mobile_admin/controllers/yb"
- "github.com/beego/beego/v2/server/web"
- )
- func init() {
-
- web.InsertFilter("*", web.BeforeRouter, cors.Allow(&cors.Options{
- AllowAllOrigins: true,
- AllowMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
- AllowHeaders: []string{"Origin", "Authorization", "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 := web.NewNamespace("/h5adminapi",
- web.NSNamespace("/wechat",
- web.NSInclude(
- &controllers.WeChatCommon{},
- ),
- ),
- web.NSNamespace("/admin",
- web.NSInclude(
- &controllers.AdminCommon{},
- ),
- ),
- web.NSNamespace("/admin_wx",
- web.NSInclude(
- &controllers.AdminWxController{},
- ),
- ),
- web.NSNamespace("/approval",
- web.NSInclude(
- &controllers.ApprovalCommon{},
- ),
- ),
- web.NSNamespace("/message",
- web.NSInclude(
- &controllers.MessageCommon{},
- ),
- ),
- web.NSNamespace("/company_contract",
- web.NSInclude(
- &controllers.CompanyContractCommon{},
- ),
- ),
- web.NSNamespace("/contract",
- web.NSInclude(
- &controllers.ContractCommon{},
- ),
- ),
- web.NSNamespace("/contract_approval",
- web.NSInclude(
- &controllers.ContractApprovalCommon{},
- ),
- ),
- web.NSNamespace("/seal",
- web.NSInclude(
- &controllers.SealCommon{},
- ),
- ),
- web.NSNamespace("/seal_approval",
- web.NSInclude(
- &controllers.SealApprovalCommon{},
- ),
- ),
- web.NSNamespace("/resource",
- web.NSInclude(
- &controllers.ResourceCommon{},
- ),
- ),
- web.NSNamespace("/roadshow",
- web.NSInclude(
- &roadshow.CalendarController{},
- ),
- ),
- web.NSNamespace("/yb",
- web.NSInclude(
- &yb.CommunityQuestionController{},
- &yb.CommunityQuestionCommentController{},
- ),
- ),
- web.NSNamespace("/taglib",
- web.NSInclude(
- &controllers.VarietyTagController{},
- ),
- ),
- web.NSNamespace("/business_trip",
- web.NSInclude(
- &business_trip.BusinessTrip{},
- ),
- ),
- web.NSNamespace("/system",
- web.NSInclude(
- &controllers.SystemCommon{},
- ),
- ),
- web.NSNamespace("/custom",
- web.NSInclude(
- &controllers.CompanySellerController{},
- ),
- ),
- )
- web.AddNamespace(ns)
- }
|