feat: 修改小程序跳转链接

This commit is contained in:
zdl
2025-11-27 10:46:14 +08:00
parent c822b153d2
commit 4560467523

4
app.py
View File

@@ -3490,11 +3490,11 @@ def get_wechat_h5_auth_url():
# 编码回调地址
redirect_uri = urllib.parse.quote_plus(WECHAT_REDIRECT_URI)
# 构建授权 URL使用 snsapi_login 获取用户信息
# 构建授权 URL使用 snsapi_userinfo 获取用户信息,仅限微信内 H5 使用
auth_url = (
f"https://open.weixin.qq.com/connect/oauth2/authorize?"
f"appid={WECHAT_APPID}&redirect_uri={redirect_uri}"
f"&response_type=code&scope=snsapi_login&state={state}"
f"&response_type=code&scope=snsapi_userinfo&state={state}"
"#wechat_redirect"
)