feat(dev): 增加独立分销前台端口5191、标签页会话隔离与免hosts二级域名支持
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { apiClient } from '@/shared/api/client'
|
||||
|
||||
import type { ApiResponse, PaginatedResult } from '@/shared/types/types'
|
||||
import { getEffectiveSiteCode } from '@/stores/distributionSite'
|
||||
import type { BalanceType, LedgerDirection, WalletStatus } from '@/shared/types/status'
|
||||
|
||||
export interface WalletAccount {
|
||||
@@ -28,10 +28,7 @@ export interface WalletLedger {
|
||||
}
|
||||
|
||||
export async function fetchWalletBalance(distributionSiteCode?: string) {
|
||||
const siteCode =
|
||||
distributionSiteCode ||
|
||||
(typeof window !== 'undefined' ? localStorage.getItem('hfb_site_code') : '') ||
|
||||
undefined
|
||||
const siteCode = distributionSiteCode || getEffectiveSiteCode() || undefined
|
||||
const params: Record<string, unknown> = {}
|
||||
if (siteCode) {
|
||||
params.distribution_site_code = siteCode
|
||||
@@ -41,10 +38,7 @@ export async function fetchWalletBalance(distributionSiteCode?: string) {
|
||||
}
|
||||
|
||||
export async function fetchWalletLedger(page = 1, pageSize = 20, distributionSiteCode?: string) {
|
||||
const siteCode =
|
||||
distributionSiteCode ||
|
||||
(typeof window !== 'undefined' ? localStorage.getItem('hfb_site_code') : '') ||
|
||||
undefined
|
||||
const siteCode = distributionSiteCode || getEffectiveSiteCode() || undefined
|
||||
const params: Record<string, unknown> = { page, page_size: pageSize }
|
||||
if (siteCode) {
|
||||
params.distribution_site_code = siteCode
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { apiClient } from '@/shared/api/client'
|
||||
|
||||
import type { ApiResponse, PaginatedResult } from '@/shared/types/types'
|
||||
import { getEffectiveSiteCode } from '@/stores/distributionSite'
|
||||
|
||||
// 收款账号类型
|
||||
export type AccountType = 'alipay' | 'wechat' | 'bank'
|
||||
@@ -116,11 +116,7 @@ export async function createWithdrawal(
|
||||
req: CreateWithdrawalRequest,
|
||||
distributionSiteCode?: string
|
||||
) {
|
||||
const siteCode =
|
||||
distributionSiteCode ||
|
||||
req.distribution_site_code ||
|
||||
(typeof window !== 'undefined' ? localStorage.getItem('hfb_site_code') : '') ||
|
||||
undefined
|
||||
const siteCode = distributionSiteCode || req.distribution_site_code || getEffectiveSiteCode() || undefined
|
||||
const payload: CreateWithdrawalRequest = { ...req }
|
||||
if (siteCode) {
|
||||
payload.distribution_site_code = siteCode
|
||||
@@ -130,10 +126,7 @@ export async function createWithdrawal(
|
||||
}
|
||||
|
||||
export async function fetchWithdrawals(page = 1, pageSize = 20, distributionSiteCode?: string) {
|
||||
const siteCode =
|
||||
distributionSiteCode ||
|
||||
(typeof window !== 'undefined' ? localStorage.getItem('hfb_site_code') : '') ||
|
||||
undefined
|
||||
const siteCode = distributionSiteCode || getEffectiveSiteCode() || undefined
|
||||
const params: Record<string, unknown> = { page, page_size: pageSize }
|
||||
if (siteCode) {
|
||||
params.distribution_site_code = siteCode
|
||||
|
||||
Reference in New Issue
Block a user