feat: 积分商城-供应商-对账-发票4
This commit is contained in:
@@ -4,6 +4,10 @@ const API_BASE = import.meta.env.VITE_SUPPLIED_ADMIN_API_BASE || 'http://127.0.0
|
||||
|
||||
const normalizeBase = (base: string) => base.replace(/\/$/, '')
|
||||
|
||||
export const resolveImageUrl = (value: string) => /^\/api\/(?:file|upload-preview)\?/.test(value)
|
||||
? `${normalizeBase(API_BASE).replace(/\/api\/admin$/, '')}${value.replace('/api/upload-preview?', '/api/file?')}`
|
||||
: value
|
||||
|
||||
export const postAdmin = async <T>(name: string, body: Record<string, unknown>): Promise<T> => {
|
||||
const token = readAdminSession()?.token
|
||||
const response = await fetch(`${normalizeBase(API_BASE)}/${name}`, {
|
||||
|
||||
Reference in New Issue
Block a user