Browse Source

检测登陆失败原因

pull/98/head
pengda 1 month ago
parent
commit
bf96ab94a5
  1. 4
      src/utils/request.js

4
src/utils/request.js

@ -1,7 +1,7 @@
// src/utils/request.js
import axios from "axios";
import { handleTokenRefresh } from '@/utils/loginRefresh';
import { host } from '@/config/host';
// import { host } from '@/config/host';
// 创建 axios 实例
const service = axios.create({
@ -53,7 +53,7 @@ service.interceptors.response.use(
switch (error.response.status) {
case 401:
// 未授权,跳转到登录页
window.location.href = host;
window.location.href = "/";
break;
case 402:
// token失效

Loading…
Cancel
Save