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()