微信小程序页面迁移校验之前 P5任务处理之前
This commit is contained in:
@@ -12,7 +12,7 @@ import logging
|
||||
|
||||
import httpx
|
||||
|
||||
from app.config import get
|
||||
from app.config import WX_APPID, WX_SECRET
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -59,8 +59,8 @@ async def code2session(code: str) -> dict:
|
||||
WeChatAuthError: 微信接口返回非零 errcode 时抛出
|
||||
RuntimeError: WX_APPID / WX_SECRET 环境变量缺失时抛出
|
||||
"""
|
||||
appid = get("WX_APPID", "")
|
||||
secret = get("WX_SECRET", "")
|
||||
appid = WX_APPID
|
||||
secret = WX_SECRET
|
||||
|
||||
if not appid or not secret:
|
||||
raise RuntimeError("微信配置缺失:WX_APPID 或 WX_SECRET 未设置")
|
||||
|
||||
Reference in New Issue
Block a user