feat:后台设置页面

This commit is contained in:
Lan
2024-11-23 16:39:42 +08:00
parent bb79c66ced
commit 9693f3d329
15 changed files with 2313 additions and 121 deletions
+3 -2
View File
@@ -1,4 +1,5 @@
import axios from 'axios'
import { useRouter } from 'vue-router'
// 从环境变量中获取 API 基础 URL
const baseURL =
@@ -38,7 +39,6 @@ api.interceptors.request.use(
return Promise.reject(error)
}
)
// 响应拦截器
api.interceptors.response.use(
(response) => {
@@ -49,8 +49,9 @@ api.interceptors.response.use(
if (error.response) {
switch (error.response.status) {
case 401:
// 未授权,可能需要重新登录
console.error('未授权,请重新登录')
localStorage.clear()
window.location.href = '/login'
break
case 403:
// 禁止访问