2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 13:47:15 +08:00

feat: alova.js替换axios

This commit is contained in:
耗子
2025-02-09 04:19:44 +08:00
parent 9956824d54
commit a07c50b3f5
41 changed files with 376 additions and 463 deletions

View File

@@ -47,14 +47,18 @@ export const http = createAlova({
const { meta } = method
if (status !== 200) {
const code = json?.code ?? status
const message = resolveResError(code, json?.message ?? statusText)
console.log(json)
const message = resolveResError(
code,
json?.message && json.message.trim() !== '' ? json.message : statusText
)
const noAlert = meta?.noAlert
if (!noAlert) {
if (code === 422) {
window.$message.error(message)
} else if (code !== 401) {
window.$dialog.error({
title: '接口响应异常',
title: '错误',
content: message,
maskClosable: false
})