diff --git a/src/api/wechat/index.ts b/src/api/wechat/index.ts index 9c058ad..c8fdf88 100644 --- a/src/api/wechat/index.ts +++ b/src/api/wechat/index.ts @@ -48,7 +48,10 @@ export async function getFollowQrcode(): Promise { /** H5 网页授权:从其他配置 wechat_mp 读取 AppId / OAuth 回调根 */ export async function getWeChatOAuthConfig(): Promise { - const res = await axiosInstance.get(omsUrl('/wechat/mp/oauth-config')); + // 不带默认 Content-Type,避免无必要的 CORS 预检(OPTIONS 易被网关/路由判 405) + const res = await axiosInstance.get(omsUrl('/wechat/oauth/config'), { + headers: { 'Content-Type': undefined as unknown as string }, + }); const data = unwrapOrSelf>(res.data); const appId = String(data.appId ?? data.AppId ?? '').trim(); const oauthRedirectBase = String(