feat(distribution): 独立分销前台商城多租户体系、货源与订单数据严格隔离

This commit is contained in:
yml2213
2026-09-07 17:18:14 +08:00
parent 550b42eb22
commit ecaf15417b
34 changed files with 2397 additions and 119 deletions
@@ -106,6 +106,7 @@ export interface PublicListingQuery {
max_daily_loss?: number
min_secret_kd?: number
max_secret_kd?: number
distribution_site_code?: string
[key: `resource_${string}_min`]: number | undefined
[key: `resource_${string}_max`]: number | undefined
}
@@ -124,8 +125,13 @@ export async function fetchListings(query: PublicListingQuery = {}) {
}
export async function fetchListingsPage(query: PublicListingQuery = {}) {
const siteCode =
query.distribution_site_code ||
(typeof window !== 'undefined' ? localStorage.getItem('hfb_site_code') : '') ||
undefined
const effectiveQuery = siteCode ? { distribution_site_code: siteCode, ...query } : query
const params = Object.fromEntries(
Object.entries(query).filter(
Object.entries(effectiveQuery).filter(
([, value]) => value !== '' && value !== undefined && value !== null
)
)