前端打包

This commit is contained in:
2025-11-24 16:53:17 +08:00
parent df57d05817
commit b51faf731a
10 changed files with 218 additions and 385 deletions

View File

@@ -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',