918f6962 by renchao@pashanhoo.com

style:router

1 parent 971be918
1
1 /* 2 /*
2 * @Description: 此文件主要创建 axios 实例,然后添加请求拦截器和响应拦截器 3 * @Description: 此文件主要创建 axios 实例,然后添加请求拦截器和响应拦截器
3 * @Autor: renchao 4 * @Autor: renchao
4 * @LastEditTime: 2023-06-02 10:07:55 5 * @LastEditTime: 2023-06-02 10:18:32
5 */ 6 */
6 import axios from 'axios' 7 import axios from 'axios'
8 import Router from '@/router'
7 import Cookies from 'js-cookie' 9 import Cookies from 'js-cookie'
8 import { Message } from 'element-ui' 10 import { Message } from 'element-ui'
9 import { endLoadingSubCount } from './requestLoading' 11 import { endLoadingSubCount } from './requestLoading'
...@@ -78,14 +80,13 @@ service.interceptors.response.use( ...@@ -78,14 +80,13 @@ service.interceptors.response.use(
78 } else { 80 } else {
79 Cookies.remove('token') 81 Cookies.remove('token')
80 } 82 }
81
82 if (window._config.casEnable) { 83 if (window._config.casEnable) {
83 window.location.href = window._config.casBaseURL + '/logout?service=' + encodeURIComponent(locationUrl); 84 window.location.href = window._config.casBaseURL + '/logout?service=' + encodeURIComponent(locationUrl);
84 } else { 85 } else {
85 router.replace({ 86 Router.replace({
86 path: '/login', 87 path: '/login',
87 query: { 88 query: {
88 redirect: router.currentRoute.value.fullPath 89 redirect: Router.currentRoute.value.fullPath
89 } 90 }
90 }) 91 })
91 return false 92 return false
......