fix(h5-shop): tip unbound WeChat login to use phone first

This commit is contained in:
2026-08-02 13:15:47 +08:00
parent 45d3d8164d
commit ab3b230d01
4 changed files with 53 additions and 13 deletions
@@ -20,6 +20,9 @@ import {
fetchClientConfig,
handleShopWechatCallback,
handleShopWechatLoginResult,
isShopWechatUnboundError,
SHOP_WX_NEED_PHONE_LOGIN_MSG,
stashShopWechatLoginHint,
} from '../lib/wechat-auth';
import { isWechatEnv } from '../lib/weixin';
@@ -83,7 +86,11 @@ export function StoreSessionProvider({ children }: { children: ReactNode }) {
}
stripOAuthParamsFromLocation();
}
} catch {
} catch (e) {
const raw = e instanceof Error ? e.message : '';
if (isShopWechatUnboundError(raw)) {
stashShopWechatLoginHint(SHOP_WX_NEED_PHONE_LOGIN_MSG);
}
stripOAuthParamsFromLocation();
}
}