前端打包
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import axios, { AxiosResponse, AxiosError, InternalAxiosRequestConfig } from "axios";
|
||||
import { ElLoading, ElMessage } from "element-plus";
|
||||
import type { ResultDomain } from "@/types";
|
||||
import { API_BASE_URL } from "@/config";
|
||||
|
||||
/**
|
||||
* 扩展AxiosRequestConfig以支持自定义配置
|
||||
@@ -67,9 +68,13 @@ export const TokenManager = {
|
||||
|
||||
/**
|
||||
* 创建axios实例
|
||||
*
|
||||
* 说明:
|
||||
* - 统一使用配置模块提供的 API_BASE_URL 作为基础路径
|
||||
* - API_BASE_URL 在开发环境来自 devConfig,在生产环境来自 window.APP_RUNTIME_CONFIG
|
||||
*/
|
||||
const request = axios.create({
|
||||
baseURL: import.meta.env.VITE_API_BASE_URL || "/api",
|
||||
baseURL: API_BASE_URL,
|
||||
timeout: 30000,
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
|
||||
Reference in New Issue
Block a user