testcase
This commit is contained in:
parent
fc44c34aaf
commit
e17e94cbeb
|
|
@ -12,6 +12,7 @@
|
||||||
"axios": "^0.27.2",
|
"axios": "^0.27.2",
|
||||||
"core-js": "^3.8.3",
|
"core-js": "^3.8.3",
|
||||||
"echarts": "^5.3.3",
|
"echarts": "^5.3.3",
|
||||||
|
"nprogress": "^0.2.0",
|
||||||
"pinia": "^2.0.18",
|
"pinia": "^2.0.18",
|
||||||
"pinia-plugin-persist": "^1.0.0",
|
"pinia-plugin-persist": "^1.0.0",
|
||||||
"vue": "^3.2.13",
|
"vue": "^3.2.13",
|
||||||
|
|
@ -7661,6 +7662,11 @@
|
||||||
"node": ">=4"
|
"node": ">=4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/nprogress": {
|
||||||
|
"version": "0.2.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/nprogress/-/nprogress-0.2.0.tgz",
|
||||||
|
"integrity": "sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA=="
|
||||||
|
},
|
||||||
"node_modules/nth-check": {
|
"node_modules/nth-check": {
|
||||||
"version": "2.1.1",
|
"version": "2.1.1",
|
||||||
"resolved": "https://registry.npmmirror.com/nth-check/-/nth-check-2.1.1.tgz",
|
"resolved": "https://registry.npmmirror.com/nth-check/-/nth-check-2.1.1.tgz",
|
||||||
|
|
@ -17229,6 +17235,11 @@
|
||||||
"path-key": "^2.0.0"
|
"path-key": "^2.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nprogress": {
|
||||||
|
"version": "0.2.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/nprogress/-/nprogress-0.2.0.tgz",
|
||||||
|
"integrity": "sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA=="
|
||||||
|
},
|
||||||
"nth-check": {
|
"nth-check": {
|
||||||
"version": "2.1.1",
|
"version": "2.1.1",
|
||||||
"resolved": "https://registry.npmmirror.com/nth-check/-/nth-check-2.1.1.tgz",
|
"resolved": "https://registry.npmmirror.com/nth-check/-/nth-check-2.1.1.tgz",
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
"axios": "^0.27.2",
|
"axios": "^0.27.2",
|
||||||
"core-js": "^3.8.3",
|
"core-js": "^3.8.3",
|
||||||
"echarts": "^5.3.3",
|
"echarts": "^5.3.3",
|
||||||
|
"nprogress": "^0.2.0",
|
||||||
"pinia": "^2.0.18",
|
"pinia": "^2.0.18",
|
||||||
"pinia-plugin-persist": "^1.0.0",
|
"pinia-plugin-persist": "^1.0.0",
|
||||||
"vue": "^3.2.13",
|
"vue": "^3.2.13",
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import router from './router'
|
||||||
import './assets/css/style.css'
|
import './assets/css/style.css'
|
||||||
import Echarts from "vue-echarts";
|
import Echarts from "vue-echarts";
|
||||||
import "echarts"
|
import "echarts"
|
||||||
|
import "nprogress/nprogress.css"
|
||||||
const app = createApp(App)
|
const app = createApp(App)
|
||||||
import {createPinia} from "pinia";
|
import {createPinia} from "pinia";
|
||||||
const pina = createPinia()
|
const pina = createPinia()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import {message} from "ant-design-vue";
|
import {message} from "ant-design-vue";
|
||||||
import {useRouter} from "vue-router";
|
import {useRouter} from "vue-router";
|
||||||
|
import NProgress from "nprogress"
|
||||||
|
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
baseURL: 'http://192.168.0.103:8000/api',
|
baseURL: 'http://192.168.0.103:8000/api',
|
||||||
|
|
@ -10,6 +11,7 @@ const router = useRouter()
|
||||||
|
|
||||||
service.interceptors.request.use(function (config) {
|
service.interceptors.request.use(function (config) {
|
||||||
console.log(config)
|
console.log(config)
|
||||||
|
NProgress.start()
|
||||||
const token = window.sessionStorage.getItem("token")
|
const token = window.sessionStorage.getItem("token")
|
||||||
if (token !== "" || token != null || token != '') {
|
if (token !== "" || token != null || token != '') {
|
||||||
config.headers["Authorization"] = "Bearer " +token
|
config.headers["Authorization"] = "Bearer " +token
|
||||||
|
|
@ -23,4 +25,12 @@ service.interceptors.request.use(function (config) {
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
service.interceptors.response.use(function (response) {
|
||||||
|
NProgress.done();
|
||||||
|
return response;
|
||||||
|
},function (error) {
|
||||||
|
|
||||||
|
return Promise.reject(error)
|
||||||
|
});
|
||||||
|
|
||||||
export default service;
|
export default service;
|
||||||
Loading…
Reference in New Issue