feat(distribution): 独立分销前台商城多租户体系、货源与订单数据严格隔离
This commit is contained in:
@@ -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
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user