fix(h5-partner): resolve merge conflicts for auth and sub-accounts

Merge partner session model (AuthGate, ensureSession, WeChat OAuth in Context) with sub-account routing, admin partner-account tree CRUD, upload lock, and partner staff flows.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-10 11:24:48 +08:00
20 changed files with 378 additions and 264 deletions
+6 -3
View File
@@ -1,4 +1,4 @@
import type { PartnerMe } from '@dukang/shared-types';
import type { PartnerMe, PartnerStaffRole } from '@dukang/shared-types';
import { isOnAppPath, toAppPath } from '@dukang/weixin-sdk';
import { showPartnerToast } from './toast';
@@ -22,7 +22,9 @@ const AUTH_RECOVERY_EXEMPT_PATHS = [
'/partner/auth/login/wechat',
];
export type PartnerSessionProfile = Pick<PartnerMe, 'id' | 'name' | 'phone' | 'companyName' | 'isPrimary'>;
export type PartnerSessionProfile = Pick<PartnerMe, 'id' | 'name' | 'phone' | 'companyName' | 'isPrimary'> & {
staffRole?: PartnerStaffRole;
};
export type PartnerSessionPayload = {
accessToken: string;
@@ -31,7 +33,7 @@ export type PartnerSessionPayload = {
};
export type ApiRequestOptions = RequestInit & {
/** 为 true 时不弹出 toast(由调用方自行展示) */
/** 保留字段,兼容旧调用;错误提示由页面自行处理 */
silent?: boolean;
};
@@ -101,6 +103,7 @@ function profileFromMe(me: PartnerMe): PartnerSessionProfile {
phone: me.phone,
companyName: me.companyName,
isPrimary: me.isPrimary,
staffRole: me.staffRole ?? undefined,
};
}