This commit is contained in:
duanxiaohai 2024-09-26 17:06:05 +08:00
parent f6437c19bd
commit 83b6ecbcc8
3 changed files with 13 additions and 14 deletions

BIN
dist.zip

Binary file not shown.

View File

@ -30,18 +30,25 @@ axios.interceptors.response.use(
(error) => {
if (error.response) {
if (error.response.status == 401) {
// console.log(error.response,"响应拦截器失败")
ElMessage.error("请重新登录!");
// console.log(error.response,"响应拦截器失败")
// window.location.href = '/#/login?returnURL=' + window.location.href
// window.location.href =
// "http://220.191.238.50:996/api/login?returnURL=" +
// window.location.href;
// const cookies = document.cookie.split(";");
// for (let i = 0; i < cookies.length; i++) {
// const cookie = cookies[i];
// const eqPos = cookie.indexOf("=");
// const name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
// document.cookie =
// name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/;";
// }
router.replace({
path: '/guide'
path: "/guide",
});
} else if (error.response.status == 404) {
ElMessage.error("Status:404正在请求不存在的服务器记录");
} else if (error.response.status == 500) {

View File

@ -159,7 +159,9 @@ const login = () => {
})
.catch((err) => {
console.log(err);
var token = getCookie("lytoken");
// var token = '6b0e380b4a8f46baae4923f83faf670d';
// console.log('token', token)
if (!token) {
@ -199,16 +201,6 @@ onMounted(() => {
// cookie
// clearCookies();
login();
// let token = tools.data.get("token");
// console.log(token, "token");
// if (token == null) {
// ElMessage.error({
// message: "!",
// offset: 100,
// });
// window.location.href =
// "http://220.191.238.50:996/api/login?returnURL=" + window.location.href;
// }
reset_font();
reset_font();
});