From 1b03a7aa05c7336be34fb269163c611ff285c32d Mon Sep 17 00:00:00 2001 From: skimrme Date: Sat, 21 Mar 2026 22:11:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=82=E6=97=B6=E8=A7=A3=E5=86=B3session?= =?UTF-8?q?=E9=9A=8F=E6=9C=BA=E6=95=B0=E4=B8=8D=E5=A4=9F=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 40748db..c2c2b79 100755 --- a/main.py +++ b/main.py @@ -6,6 +6,7 @@ from blueprint.kami_views import kami_bp from blueprint.index_views import index_bp import os import sqlite3 +import secrets def get_owp_db_conn(): conn = sqlite3.connect('/var/open-ww3-project-ww3-tw/databases/sqlite/owp.db') @@ -16,9 +17,9 @@ app = Flask(__name__, static_url_path='/static/') # session -#app.secret_key = "508948973a8651f160baf3b26f18c47d" -app.secret_key = '玩鵬畝遜溉痕叛課還擇鼇粹拜溜泉聰倡效蘭鱅都凍芝西鄂' - +# 随机数生成 +key_hex = secrets.token_hex(32) +app.secret_key = key_hex # 注册蓝图