1
Some checks failed
CI / build (push) Has been cancelled

This commit is contained in:
jrhlh
2025-07-18 18:49:59 +08:00
parent 3eeebab4f8
commit bd1fc93771
30 changed files with 119 additions and 177 deletions

View File

@ -92,20 +92,7 @@ def create_app():
app.get_db = get_db
# 启用 CORS跨域支持
CORS(app,
resources={r"/*": {
"origins": [
"http://localhost:8080",
"http://127.0.0.1:8080",
"http://[::1]:8080",
"http://localhost:5173",
"http://127.0.0.1:5173",
"http://[::1]:5173"
],
"supports_credentials": True,
"allow_headers": ["Content-Type", "Authorization"],
"methods": ["GET", "POST", "PUT", "DELETE", "OPTIONS"]
}})
CORS(app, resources={r"/*": {"origins": "*"}}) # 允许所有来源或指定局域网IP
# 注册蓝图
from blueprints.login import bp as login_bp
@ -165,4 +152,4 @@ def create_app():
if __name__ == '__main__':
app = create_app()
app.run(debug=True)
app.run(host='0.0.0.0', port=5000, debug=True)