画廊-瀑布流实现

This commit is contained in:
2025-08-11 17:06:29 +08:00
parent 0438a2dcfb
commit 22ca45510b
9 changed files with 256 additions and 20 deletions

View File

@ -1,3 +1,4 @@
import router from "@/router";
import type { AxiosError, AxiosResponse, InternalAxiosRequestConfig } from "axios";
import axios from "axios";
import { useCookies } from "vue3-cookies";
@ -43,13 +44,21 @@ request.interceptors.response.use(
// 对响应错误做点什么
console.log("Response error", error);
// if (error.response?.status === 401) {
// window.$msg.warning("无效的token");
// cookies.remove("token");
// cookies.remove("userinfo");
// router.replace("/login");
// return "Unauthorized";
// }
if (error.response?.status === 401) {
// window.$msg.warning("无效的token");
cookies.remove("token");
cookies.remove("userinfo");
window.$modal({
title: "无效的token",
content: "token已失效需要登录请登录 =>",
handdleSubmit: () => {
router.replace("/login");
},
});
// router.replace("/login");
return "Unauthorized";
}
return error.message || "Response error";
}