tmp
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
import { notify } from '~/utils/notify'
|
||||
|
||||
// 生产环境走 https://api.huashengtec.com;本地为空,仍由 vite proxy 转发
|
||||
const API_BASE = (import.meta.env.VITE_API_BASE || '').replace(/\/+$/, '')
|
||||
|
||||
let authToken = ''
|
||||
let unauthorizedHandler: (() => void) | null = null
|
||||
|
||||
@@ -47,7 +50,7 @@ export async function request<T>(path: string, options: RequestOptions = {}): Pr
|
||||
|
||||
let response: Response
|
||||
try {
|
||||
response = await fetch(`${path}${buildQuery(query)}`, {
|
||||
response = await fetch(`${API_BASE}${path}${buildQuery(query)}`, {
|
||||
method,
|
||||
headers,
|
||||
body: body === undefined ? undefined : JSON.stringify(body),
|
||||
|
||||
Reference in New Issue
Block a user