13efbe31 by xiaomiao
2 parents 6e703f0b 2f686431
1 { 1 {
2 "TITLE": "汉中市数据上报系统", 2 "TITLE": "汉中市数据上报系统",
3 "THEME": "sb", 3 "THEME": "sb",
4 "CODE": "BDCJGPT", 4 "CODE": "BDCSBPT",
5 "SERVERAPI": "/bdcsjsb", 5 "SERVERAPI": "/bdcsjsb",
6 "calcHeight": 160, 6 "calcHeight": 160,
7 "echartTextColor": "#4A4A4A", 7 "echartTextColor": "#4A4A4A",
......
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:
......