(
This commit is contained in:
parent
c8542198ef
commit
9b94d5e9e4
@ -1,7 +1,7 @@
|
||||
import axios from 'axios';
|
||||
import { logoutUser } from '../utils/jwt'; // logoutUser会处理清除存储和重定向
|
||||
|
||||
const API_BASE_URL = 'http://zybdatasupport.online:8000';
|
||||
const API_BASE_URL = 'https://zybdatasupport.online';
|
||||
|
||||
const axiosInstance = axios.create({
|
||||
baseURL: API_BASE_URL,
|
||||
|
@ -1,54 +1,6 @@
|
||||
import axiosInstance from './axiosConfig';
|
||||
import { loginSuccess } from '../utils/jwt';
|
||||
|
||||
// const API_BASE_URL = 'http://zybdatasupport.online:8000' // 不再需要
|
||||
|
||||
// // 创建 axios 实例 // 不再需要
|
||||
// const axiosInstance = axios.create({
|
||||
// baseURL: API_BASE_URL,
|
||||
// headers: {
|
||||
// 'Content-Type': 'application/json',
|
||||
// 'Accept': 'application/json',
|
||||
// 'X-Requested-With': 'XMLHttpRequest'
|
||||
// },
|
||||
// timeout: 10000 // 添加超时设置
|
||||
// })
|
||||
|
||||
// // 设置请求拦截器,自动添加 token // 不再需要
|
||||
// axiosInstance.interceptors.request.use(
|
||||
// config => {
|
||||
// const token = localStorage.getItem('access_token')
|
||||
// if (token) {
|
||||
// config.headers.Authorization = `bearer ${token}`
|
||||
// }
|
||||
// return config
|
||||
// },
|
||||
// error => {
|
||||
// return Promise.reject(error)
|
||||
// }
|
||||
// )
|
||||
|
||||
// // 添加响应拦截器 // 不再需要
|
||||
// axiosInstance.interceptors.response.use(
|
||||
// response => response,
|
||||
// error => {
|
||||
// if (error.response) {
|
||||
// // 服务器返回错误状态码
|
||||
// console.error('请求错误:', {
|
||||
// status: error.response.status,
|
||||
// data: error.response.data,
|
||||
// config: error.config
|
||||
// })
|
||||
// } else if (error.request) {
|
||||
// // 请求已发出但没有收到响应
|
||||
// console.error('网络错误:', error.request)
|
||||
// } else {
|
||||
// // 请求配置出错
|
||||
// console.error('请求配置错误:', error.message)
|
||||
// }
|
||||
// return Promise.reject(error)
|
||||
// }
|
||||
// )
|
||||
|
||||
/**
|
||||
* 获取验证码
|
||||
|
@ -74,7 +74,7 @@
|
||||
error: null,
|
||||
currentPage: 1,
|
||||
itemsPerPage: 100,
|
||||
apiBaseUrl: 'http://zybdatasupport.online:8000',
|
||||
apiBaseUrl: 'https://zybdatasupport.online',
|
||||
categoryList: [],
|
||||
selectedCategory: '全部',
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user