From 2470cea7e41eec7f104ee53e208cf11697acb826 Mon Sep 17 00:00:00 2001 From: liangguodong Date: Wed, 11 Mar 2026 16:24:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E7=99=BB=E5=BD=95SSL=E9=AA=8C=E8=AF=81=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E6=B7=BB=E5=8A=A0=E8=AF=8A=E6=96=AD?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/app/routers/user.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/app/routers/user.py b/server/app/routers/user.py index d1b206f..cde3cfc 100644 --- a/server/app/routers/user.py +++ b/server/app/routers/user.py @@ -64,11 +64,15 @@ async def login(request: LoginRequest, db: AsyncSession = Depends(get_db)): """微信登录""" settings = get_settings() + # 打印配置状态 + print(f"[Login] wx_appid配置: {'已配置' if settings.wx_appid else '未配置'}") + print(f"[Login] wx_secret配置: {'已配置' if settings.wx_secret else '未配置'}") + # 调用微信API获取openid if settings.wx_appid and settings.wx_secret: try: url = f"https://api.weixin.qq.com/sns/jscode2session?appid={settings.wx_appid}&secret={settings.wx_secret}&js_code={request.code}&grant_type=authorization_code" - async with httpx.AsyncClient() as client: + async with httpx.AsyncClient(verify=False) as client: resp = await client.get(url, timeout=10.0) data = resp.json()