mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-09-17 16:56:38 +08:00
默认允许跨域请求API
This commit is contained in:
parent
22278c40bf
commit
775fb1f853
@ -49,11 +49,8 @@ func NewServer(appConfig *types.AppConfig) *AppServer {
|
||||
}
|
||||
|
||||
func (s *AppServer) Init(debug bool, client *redis.Client) {
|
||||
if debug { // 调试模式允许跨域请求 API
|
||||
s.Debug = debug
|
||||
// 允许跨域请求 API
|
||||
s.Engine.Use(corsMiddleware())
|
||||
logger.Info("Enabled debug mode")
|
||||
}
|
||||
s.Engine.Use(staticResourceMiddleware())
|
||||
s.Engine.Use(authorizeMiddleware(s, client))
|
||||
s.Engine.Use(parameterHandlerMiddleware())
|
||||
|
Loading…
Reference in New Issue
Block a user