update pay ui
This commit is contained in:
5
app.py
5
app.py
@@ -257,7 +257,10 @@ MAIL_PASSWORD = 'QYncRu6WUdASvTg4'
|
||||
MAIL_DEFAULT_SENDER = 'admin@valuefrontier.cn'
|
||||
|
||||
# Session和安全配置
|
||||
app.config['SECRET_KEY'] = ''.join(random.choices(string.ascii_letters + string.digits, k=32))
|
||||
# 使用固定的 SECRET_KEY,确保服务器重启后用户登录状态不丢失
|
||||
# 重要:生产环境请使用环境变量配置,不要硬编码
|
||||
import os
|
||||
app.config['SECRET_KEY'] = os.environ.get('FLASK_SECRET_KEY', 'vf_production_secret_key_2024_valuefrontier_cn')
|
||||
app.config['SESSION_COOKIE_SECURE'] = False # 如果生产环境使用HTTPS,应设为True
|
||||
app.config['SESSION_COOKIE_HTTPONLY'] = True # 生产环境应设为True,防止XSS攻击
|
||||
app.config['SESSION_COOKIE_SAMESITE'] = 'Lax' # 使用'Lax'以平衡安全性和功能性
|
||||
|
||||
Reference in New Issue
Block a user