style:request判断的完成
Showing
2 changed files
with
20 additions
and
8 deletions
1 | /* | 1 | /* |
2 | * @Description: 此文件主要创建 axios 实例,然后添加请求拦截器和响应拦截器 | 2 | * @Description: 此文件主要创建 axios 实例,然后添加请求拦截器和响应拦截器 |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-03-21 15:03:37 | 4 | * @LastEditTime: 2023-03-29 10:14:34 |
5 | */ | 5 | */ |
6 | import Vue from 'vue' | ||
6 | import axios from "axios"; | 7 | import axios from "axios"; |
7 | import { Message } from "element-ui"; | 8 | import { Message } from "element-ui"; |
8 | import { endLoadingSubCount } from "./requestLoading"; | 9 | import { endLoadingSubCount } from "./requestLoading"; |
... | @@ -68,12 +69,23 @@ function handleErrorData (status) { | ... | @@ -68,12 +69,23 @@ function handleErrorData (status) { |
68 | window.tokenValid = false; | 69 | window.tokenValid = false; |
69 | Message.error("由于长时间未操作,请重新登录!"); | 70 | Message.error("由于长时间未操作,请重新登录!"); |
70 | localStorage.removeItem("token"); | 71 | localStorage.removeItem("token"); |
71 | router.replace({ | 72 | let code = Vue.prototype.BASE_API.CODE |
72 | path: "/jg", | 73 | if (code == 'BDCSBPT') { |
73 | query: { | 74 | router.replace({ |
74 | redirect: router.history.current.fullPath, | 75 | path: "/sb", |
75 | }, | 76 | query: { |
76 | }); | 77 | redirect: router.history.current.fullPath, |
78 | }, | ||
79 | }); | ||
80 | } else { | ||
81 | router.replace({ | ||
82 | path: "/jg", | ||
83 | query: { | ||
84 | redirect: router.history.current.fullPath, | ||
85 | }, | ||
86 | }); | ||
87 | } | ||
88 | |||
77 | } | 89 | } |
78 | break; | 90 | break; |
79 | case 403: | 91 | case 403: | ... | ... |
-
Please register or sign in to post a comment