fix: 首次启动自动设置默认密码

新服务器无 .env 文件时,get_or_set_password() 自动:
1. 设置默认密码 admin123
2. 写入 .env 文件
3. 控制台打印提示

解决新服务器无法登录的问题。
This commit is contained in:
Your Name
2026-07-16 19:06:37 +08:00
parent 5ab5366534
commit 00d9750662
2 changed files with 28 additions and 1 deletions
+4
View File
@@ -13,6 +13,10 @@ from services.backup_service import set_backup_dir
def create_app():
# 确保密码已设置(首次启动自动设置默认密码)
from auth import get_or_set_password
get_or_set_password()
app = Flask(__name__)
app.config.from_object(Config)
app.config["SECRET_KEY"] = os.environ.get(