三端自适应布局与 PWA 可安装支持

新增响应式样式、手机侧滑导航、manifest 与 Service Worker;补充根路径重定向与安装 App 入口。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-15 16:58:13 +08:00
parent e8b4dbbaca
commit 28875078f1
11 changed files with 785 additions and 17 deletions
+22
View File
@@ -551,6 +551,28 @@ def login_required(f):
return wrap
@app.route("/")
def index():
if session.get("logged_in"):
return redirect(url_for("plans"))
return redirect(url_for("login"))
@app.route("/manifest.webmanifest")
def web_manifest():
response = app.send_static_file("manifest.json")
response.mimetype = "application/manifest+json"
return response
@app.route("/sw.js")
def service_worker():
response = app.send_static_file("sw.js")
response.headers["Cache-Control"] = "no-cache"
response.headers["Service-Worker-Allowed"] = "/"
return response
@app.route("/login", methods=["GET", "POST"])
def login():
if request.method == "POST":