发布2.8.1 beta版本 (#2014)
AI: 增加了AI前端绘制功能,可以根据描述生成客户端页面【授权用户专属】 自动化: 自动化模板采用了function模式,更加方便用户二次开发和自定义改动 自动化: 默认携带ID和CreatedAt排序 自动化: 所有自动化Select模板默认支持select搜索 优化:http交互报错信息增加防止多次弹出错误遮罩机制 ICON: 优化ICON逻辑,防止多次加载svg 布局:增加侧边分栏模式 布局: 顶栏模式样式优化和高亮逻辑调整 优化: 个人配置不再需要手动点击保存,会根据变化自动保存 BUG: 修复了菜单点击设为主页勾选被取消的bug 安全: 更新了jwt版本,修复CVE-2025-30204 导出: 默认支持软删除过滤 代码: 优化了部分代码逻辑 本次更新需要重新执行 npm i --------- Signed-off-by: joohwan <zhouhuan.chen@yunqutech.com > Co-authored-by: huiyifyj <jxfengyijie@gmail.com> Co-authored-by: piexlMax(奇淼 <qimiaojiangjizhao@gmail.com> Co-authored-by: okppop <okppop@protonmail.com> Co-authored-by: joohwan <zhouhuan.chen@yunqutech.com > Co-authored-by: xuedinge <781408517@qq.com>
This commit is contained in:
co-authored by
huiyifyj
piexlMax(奇淼
okppop
joohwan
xuedinge
parent
84a3c3ba7c
commit
a6255557ee
@@ -4,6 +4,9 @@ import { useUserStore } from '@/pinia/modules/user'
|
||||
import router from '@/router/index'
|
||||
import { ElLoading } from 'element-plus'
|
||||
|
||||
// 添加一个状态变量,用于跟踪是否已有错误弹窗显示
|
||||
let errorBoxVisible = false
|
||||
|
||||
const service = axios.create({
|
||||
baseURL: import.meta.env.VITE_BASE_API,
|
||||
timeout: 99999
|
||||
@@ -93,7 +96,13 @@ service.interceptors.response.use(
|
||||
closeLoading()
|
||||
}
|
||||
|
||||
// 如果已经有错误弹窗显示,则不再显示新的弹窗
|
||||
if (errorBoxVisible) {
|
||||
return error
|
||||
}
|
||||
|
||||
if (!error.response) {
|
||||
errorBoxVisible = true
|
||||
ElMessageBox.confirm(
|
||||
`
|
||||
<p>检测到请求错误</p>
|
||||
@@ -106,12 +115,16 @@ service.interceptors.response.use(
|
||||
confirmButtonText: '稍后重试',
|
||||
cancelButtonText: '取消'
|
||||
}
|
||||
)
|
||||
).finally(() => {
|
||||
// 弹窗关闭后重置状态
|
||||
errorBoxVisible = false
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
switch (error.response.status) {
|
||||
case 500:
|
||||
errorBoxVisible = true
|
||||
ElMessageBox.confirm(
|
||||
`
|
||||
<p>检测到接口错误${error}</p>
|
||||
@@ -128,9 +141,13 @@ service.interceptors.response.use(
|
||||
const userStore = useUserStore()
|
||||
userStore.ClearStorage()
|
||||
router.push({ name: 'Login', replace: true })
|
||||
}).finally(() => {
|
||||
// 弹窗关闭后重置状态
|
||||
errorBoxVisible = false
|
||||
})
|
||||
break
|
||||
case 404:
|
||||
errorBoxVisible = true
|
||||
ElMessageBox.confirm(
|
||||
`
|
||||
<p>检测到接口错误${error}</p>
|
||||
@@ -143,9 +160,13 @@ service.interceptors.response.use(
|
||||
confirmButtonText: '我知道了',
|
||||
cancelButtonText: '取消'
|
||||
}
|
||||
)
|
||||
).finally(() => {
|
||||
// 弹窗关闭后重置状态
|
||||
errorBoxVisible = false
|
||||
})
|
||||
break
|
||||
case 401:
|
||||
errorBoxVisible = true
|
||||
ElMessageBox.confirm(
|
||||
`
|
||||
<p>无效的令牌</p>
|
||||
@@ -162,6 +183,9 @@ service.interceptors.response.use(
|
||||
const userStore = useUserStore()
|
||||
userStore.ClearStorage()
|
||||
router.push({ name: 'Login', replace: true })
|
||||
}).finally(() => {
|
||||
// 弹窗关闭后重置状态
|
||||
errorBoxVisible = false
|
||||
})
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user