刘嘉威
2023-10-11 c1965cec885c8661ff4fa83907d8f6d460553ed9
src/api/api.ts
@@ -1,7 +1,7 @@
/*
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-10-25 15:34:56
 * @LastEditTime: 2023-05-08 17:44:36
 */
import axios from 'axios';
@@ -16,7 +16,7 @@
export { baseUrl };
// axios.defaults.withCredentials = true;
// 添加请求拦截器
axios.interceptors.request.use(function (config: AxiosRequestConfig) {
axios.interceptors.request.use(function (config: AxiosRequestConfig):any {
    // 在发送请求之前做些什么 传token
    let token: any = getLocalStorage(StorageEnum.GB_TOKEN_STORE);
    if (token) {
@@ -114,7 +114,7 @@
 */
export const GETNOBASE = async (url: string, params?: Params): Promise<any> => {
    try {
        const data = await axios.get(location.pathname+url, {
        const data = await axios.get(url, {
            params: params,
        });
        return data;