finish init again
This commit is contained in:
4
src/api/ImageUrl.ts
Normal file
4
src/api/ImageUrl.ts
Normal file
@ -0,0 +1,4 @@
|
||||
// export const downLoadImage = 'http://1.94.237.210:3457/file/download/'
|
||||
export const downLoadImage = 'http://27.30.77.229:9092/file/download/'
|
||||
|
||||
|
32
src/api/myAxios.ts
Normal file
32
src/api/myAxios.ts
Normal file
@ -0,0 +1,32 @@
|
||||
// 创建实例时配置默认值
|
||||
import axios from "axios";
|
||||
import router from "../router";
|
||||
|
||||
// const viteEnv = import.meta.env;
|
||||
|
||||
const myAxios = axios.create({
|
||||
withCredentials: true,
|
||||
//baseURL:'http://localhost:9091'
|
||||
// baseURL:'http://1.94.237.210:3457'
|
||||
//baseURL:'http://1.94.237.210:8088'
|
||||
// baseURL:'http://27.30.77.229:9091/'
|
||||
baseURL:'http://27.30.77.229:9092/'
|
||||
|
||||
});
|
||||
|
||||
myAxios.interceptors.request.use(function (config) {
|
||||
return config;
|
||||
}, function (error) {
|
||||
return Promise.reject(error);
|
||||
});
|
||||
|
||||
myAxios.interceptors.response.use(function (response: any) {
|
||||
if (response.data.code === 40100) {
|
||||
router.replace('/')
|
||||
}
|
||||
return response.data;
|
||||
}, function (error) {
|
||||
return Promise.reject(error);
|
||||
});
|
||||
|
||||
export default myAxios;
|
Reference in New Issue
Block a user