Browse Source

chore: add wx-qr login config and encrypt exclude paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
wuzilong 1 month ago
parent
commit
7f2b5d06c1
2 changed files with 14 additions and 0 deletions
  1. 5 0
      backend/.env.example
  2. 9 0
      backend/app/core/config.py

+ 5 - 0
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

+ 9 - 0
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,"