This commit is contained in:
@@ -36,6 +36,8 @@ export type PartnerSessionProfile = Pick<
|
||||
| 'hasWechat'
|
||||
| 'wxNickname'
|
||||
| 'wxAvatarUrl'
|
||||
| 'managedWarehouseId'
|
||||
| 'hasWarehouseAccess'
|
||||
> & {
|
||||
staffRole?: PartnerStaffRole;
|
||||
};
|
||||
@@ -125,6 +127,8 @@ function profileFromMe(me: PartnerMe): PartnerSessionProfile {
|
||||
hasWechat: me.hasWechat,
|
||||
wxNickname: me.wxNickname,
|
||||
wxAvatarUrl: me.wxAvatarUrl,
|
||||
managedWarehouseId: me.managedWarehouseId,
|
||||
hasWarehouseAccess: me.hasWarehouseAccess,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,15 @@ export function getPartnerNavKind(account: PartnerMe | null | undefined): Partne
|
||||
return 'store_staff';
|
||||
}
|
||||
|
||||
/** 是否已配置管仓:主账号看 hasWarehouseAccess;子账号还需有仓库相关权限 */
|
||||
export function hasWarehouseAccess(account: PartnerMe | null | undefined): boolean {
|
||||
if (!account) return false;
|
||||
if (account.hasWarehouseAccess === false) return false;
|
||||
if (account.hasWarehouseAccess === true) return true;
|
||||
// 旧缓存无字段时保守:主账号未知视为无,避免误展示全城订单
|
||||
return false;
|
||||
}
|
||||
|
||||
export function partnerHomePath(account: PartnerMe | null | undefined): string {
|
||||
return '/';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user