fix: 🐛 引入 qs 插件对 URL 参数编码
This commit is contained in:
@@ -2,12 +2,17 @@ import axios, { InternalAxiosRequestConfig, AxiosResponse } from "axios";
|
||||
import { useUserStoreHook } from "@/store/modules/user";
|
||||
import { ResultEnum } from "@/enums/ResultEnum";
|
||||
import { TOKEN_KEY } from "@/enums/CacheEnum";
|
||||
import qs from "qs";
|
||||
|
||||
// 创建 axios 实例
|
||||
const service = axios.create({
|
||||
baseURL: import.meta.env.VITE_APP_BASE_API,
|
||||
timeout: 50000,
|
||||
headers: { "Content-Type": "application/json;charset=utf-8" },
|
||||
|
||||
paramsSerializer: (params) => {
|
||||
return qs.stringify(params);
|
||||
},
|
||||
});
|
||||
|
||||
// 请求拦截器
|
||||
|
||||
Reference in New Issue
Block a user