门店账户多账号

This commit is contained in:
2026-07-12 12:24:34 +08:00
parent 06b1cb22e0
commit 54a15d6da7
39 changed files with 1962 additions and 311 deletions
+4 -3
View File
@@ -5,6 +5,7 @@ import { isWxAuthorizeEnabled } from '@dukang/shared-types';
import { stripOAuthParamsFromLocation } from '@dukang/weixin-sdk';
import { useStoreSession } from '../contexts/StoreSessionContext';
import { getLastPhone, getStoreProfile, hasShopWxSession, request, saveAuth, type ShopSessionPayload } from '../lib/api';
import { routeAfterShopLogin } from './SelectStorePage';
import {
bindShopWechatAfterSmsLogin,
fetchClientConfig,
@@ -58,7 +59,7 @@ export default function LoginPage() {
applySession(session);
stripOAuthParamsFromLocation();
setSearchParams({}, { replace: true });
navigate('/');
routeAfterShopLogin(session, navigate);
}
})
.catch((e) => setMsg(formatWechatError(e)));
@@ -115,7 +116,7 @@ export default function LoginPage() {
await bindShopWechatAfterSmsLogin();
return;
}
navigate('/');
routeAfterShopLogin(data, navigate);
} catch (e) {
setMsg(e instanceof Error ? e.message : '登录失败');
} finally {
@@ -135,7 +136,7 @@ export default function LoginPage() {
const session = await loginShopWithWechat();
if (session) {
applySession(session);
navigate('/');
routeAfterShopLogin(session, navigate);
}
} catch (e) {
setMsg(formatWechatError(e));