fix(cors): 后端 CORS 允许 Tauri 桌面应用 origin
添加 tauri://localhost 到 CORS_ORIGINS 默认值, 解决 Tauri WebView 请求被跨域拦截的问题
This commit is contained in:
@@ -92,7 +92,7 @@ class Settings(BaseSettings):
|
||||
|
||||
# CORS 配置
|
||||
CORS_ORIGINS: str = Field(
|
||||
default="http://localhost:1420,http://127.0.0.1:1420,http://localhost:8080,http://127.0.0.1:8080",
|
||||
default="http://localhost:1420,http://127.0.0.1:1420,http://localhost:8080,http://127.0.0.1:8080,tauri://localhost",
|
||||
description="允许的跨域来源(逗号分隔)",
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user