mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-12 04:03:42 +08:00
默认允许 API 跨域访问
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
- 功能优化:后台管理新增模型的时候,可以绑定所有的 API KEY,而不只是能绑定 Chat 类型的 API KEY
|
||||
- 功能新增:新增每日签到功能,每日签到可以获得算力奖励
|
||||
- 功能优化:兼容 OpenAI o3 系列模型
|
||||
- 功能优化:API 默认开启允许跨域调用
|
||||
|
||||
## v4.1.9
|
||||
|
||||
|
||||
@@ -50,11 +50,7 @@ func NewServer(appConfig *types.AppConfig) *AppServer {
|
||||
}
|
||||
|
||||
func (s *AppServer) Init(debug bool, client *redis.Client) {
|
||||
if debug { // 调试模式允许跨域请求 API
|
||||
s.Debug = debug
|
||||
s.Engine.Use(corsMiddleware())
|
||||
logger.Info("Enabled debug mode")
|
||||
}
|
||||
s.Engine.Use(corsMiddleware())
|
||||
s.Engine.Use(staticResourceMiddleware())
|
||||
s.Engine.Use(authorizeMiddleware(s, client))
|
||||
s.Engine.Use(parameterHandlerMiddleware())
|
||||
|
||||
Reference in New Issue
Block a user