🐛 fix bug
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
package initialize
|
||||
|
||||
import (
|
||||
swaggerFiles "github.com/swaggo/files"
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
swaggerFiles "github.com/swaggo/files"
|
||||
ginSwagger "github.com/swaggo/gin-swagger"
|
||||
"net/http"
|
||||
|
||||
"miniapp/global"
|
||||
"miniapp/middleware"
|
||||
@@ -31,7 +30,7 @@ func Routers() *gin.Engine {
|
||||
Router.StaticFS(global.GVA_CONFIG.Local.StorePath, http.Dir(global.GVA_CONFIG.Local.StorePath)) // 为用户头像和文件提供静态地址
|
||||
// Router.Use(middleware.LoadTls()) // 如果需要使用https 请打开此中间件 然后前往 core/server.exe.exe.exe.go 将启动模式 更变为 Router.RunTLS("端口","你的cre/pem文件","你的key文件")
|
||||
// 跨域,如需跨域可以打开下面的注释
|
||||
// Router.Use(middleware.Cors()) // 直接放行全部跨域请求
|
||||
Router.Use(middleware.Cors()) // 直接放行全部跨域请求
|
||||
// Router.Use(middleware.CorsByRules()) // 按照配置的规则放行跨域请求
|
||||
//global.GVA_LOG.Info("use middleware cors")
|
||||
|
||||
|
Reference in New Issue
Block a user