fix:提交修复6个问题

This commit is contained in:
ljy
2026-07-08 23:01:18 +08:00
parent 99be8e0237
commit ab9654564e
43 changed files with 3671 additions and 277 deletions
+22
View File
@@ -0,0 +1,22 @@
import type { PartnerMe } from '@dukang/shared-types';
export function isPrimaryAccount(account: PartnerMe | null | undefined): boolean {
return account?.isPrimary !== false;
}
export function isSubAccount(account: PartnerMe | null | undefined): boolean {
return !!account && account.isPrimary === false;
}
export function partnerHomePath(account: PartnerMe | null | undefined): string {
return isSubAccount(account) ? '/stores/new' : '/';
}
export const SUB_ACCOUNT_ALLOWED_PREFIXES = ['/stores', '/login'];
export function isSubAccountPath(pathname: string): boolean {
if (pathname === '/login') return true;
return SUB_ACCOUNT_ALLOWED_PREFIXES.some(
(prefix) => prefix !== '/login' && (pathname === prefix || pathname.startsWith(`${prefix}/`)),
);
}