Browse Source

http.js同步代码

master
蟑螂恶霸 2 years ago
parent
commit
6b32edd9c4
  1. 2
      src/http/http.js

2
src/http/http.js

@ -3,10 +3,12 @@ import { $globalStore } from "../common/globalStore"
// import router from '@/router/home';
// import {cache} from '@/store/store';
axios.defaults.withCredentials = true
const source = axios.CancelToken.source()
const http = axios.create({
traditional: true,
contentType : "application/json",
timeout: 1000 * 1000, // 1 秒
cancelToken: source.token // 将cancel token添加到option请求中
});
const router = useRouter();
//请求拦截器添加head

Loading…
Cancel
Save