scrm-go

router.go 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package routers
  2. import (
  3. "SCRM/controllers/admin_user"
  4. "SCRM/controllers/article"
  5. "SCRM/controllers/global"
  6. "SCRM/controllers/kefu"
  7. "SCRM/controllers/login"
  8. "SCRM/controllers/marketing_tool"
  9. "SCRM/controllers/members"
  10. "SCRM/controllers/mpwechat"
  11. "SCRM/controllers/role"
  12. "SCRM/controllers/sms"
  13. "SCRM/controllers/staff"
  14. "github.com/astaxie/beego"
  15. "github.com/astaxie/beego/plugins/cors"
  16. "SCRM/controllers/site"
  17. "SCRM/controllers/micro"
  18. "github.com/astaxie/beego/context"
  19. "fmt"
  20. )
  21. func init() {
  22. fmt.Println("开始啦看hi啊啊阿道夫放大阿发大是大非身份地方阿斯蒂芬撒旦法暗室逢灯沙发发顺丰阿萨法撒旦法沙发阿萨法阿发法啊阿打发打发")
  23. beego.InsertFilter("*", beego.BeforeRouter, cors.Allow(&cors.Options{
  24. AllowOrigins: []string{"http://jk.kuyicloud.com", "http://localhost:8090","http://localhost:8091", "http://test1.sgjyun.com", "https://www.ucpaas.com","http://microweb.kuyicloud.com","http://jk.test.sgjyun.com"},
  25. AllowMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
  26. AllowHeaders: []string{"Origin", "Authorization", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
  27. ExposeHeaders: []string{"Content-Length", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
  28. AllowCredentials: true,
  29. }))
  30. beego.Get("/MP_verify_JiWyx0d2U4nzjGX5.txt", func(ctx *context.Context) {
  31. ctx.Output.Body([]byte("JiWyx0d2U4nzjGX5"))
  32. })
  33. global.RegisterRouters()
  34. admin_user.RegisterRouters()
  35. login.RegisterRouters()
  36. role.RegisterRouters()
  37. members.RegisterRouters()
  38. marketing_tool.RegisterRouters()
  39. article.RegisterRouters()
  40. mpwechat.RegisterRouters()
  41. sms.RegisterRouters()
  42. staff.RegisterRouters()
  43. kefu.RegisterRouters()
  44. site.RegisterRouters()
  45. micro.RegisterRouters()
  46. }