From 7f2b5d06c1b6b3611962e540ec1b576c26ffd715 Mon Sep 17 00:00:00 2001 From: wuzilong <704541015@qq.com> Date: Fri, 18 Sep 2026 18:15:27 +0800 Subject: [PATCH] chore: add wx-qr login config and encrypt exclude paths. Co-authored-by: Cursor --- backend/.env.example | 5 +++++ backend/app/core/config.py | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/backend/.env.example b/backend/.env.example index 55e72c652..4ff85f8ea 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -80,3 +80,8 @@ DEFAULT_TENANT_NO=shanxia2.0 # 门户小程序登录(AppID 与 miniprogram/manifest.json mp-weixin.appid 一致) # WECHAT_MP_APPID=wx7db1ddb2a90c9425 # WECHAT_MP_SECRET= + +# web-admin 扫码登录(小程序码 page 须已发布到对应 env_version) +# WX_QR_SESSION_TTL_SEC=180 +# WX_QR_ENV_VERSION=release +# WX_QR_PAGE=pages/login/web-qr/index diff --git a/backend/app/core/config.py b/backend/app/core/config.py index 075e26c03..ded079e7d 100644 --- a/backend/app/core/config.py +++ b/backend/app/core/config.py @@ -119,6 +119,11 @@ class Settings(BaseSettings): WECHAT_MP_APPID: str = "" # 门户小程序 AppID,须与 miniprogram manifest 一致 WECHAT_MP_SECRET: str = "" # 门户小程序 AppSecret(仅后端) + # web-admin 微信扫码登录(小程序码) + WX_QR_SESSION_TTL_SEC: int = 180 + WX_QR_ENV_VERSION: str = "release" # release | trial | develop + WX_QR_PAGE: str = "pages/login/web-qr/index" + # 微信模板消息ID配置 WX_TEMPLATE_ORDER_STATUS: str = "" # 订单状态通知模板ID WX_TEMPLATE_DELIVERY_NOTICE: str = "" # 配送通知模板ID @@ -164,6 +169,10 @@ class Settings(BaseSettings): "/api/web/auth/login-rsa-public-key," "/api/web/auth/login," "/api/mini/auth/wechat-login," + "/api/web/auth/wx-qr/create," + "/api/web/auth/wx-qr/status," + "/api/mini/auth/web-qr-scanned," + "/api/mini/auth/web-qr-confirm," "/api/web/auth/refresh-token," "/api/web/auth/mp-webview-exchange," "/api/web/admin/attachment/upload,"