细节提示

This commit is contained in:
18631081161 2026-04-18 19:52:48 +08:00
parent 7bfd2696d5
commit ac401b0b52
5 changed files with 13 additions and 8 deletions

View File

@ -30,7 +30,6 @@ service.interceptors.response.use(
(response) => response.data,
(error) => {
const status = error.response?.status
const message = error.response?.data?.message
if (status === 401) {
// 未登录或 token 过期,清除凭证并跳转登录页
@ -39,9 +38,8 @@ service.interceptors.response.use(
ElMessage.error('登录已过期,请重新登录')
} else if (status === 403) {
ElMessage.error('权限不足')
} else {
ElMessage.error(message || '请求失败')
}
// 其他错误(如 400不在此弹提示由业务代码自行处理
return Promise.reject(error)
}

View File

@ -147,7 +147,7 @@ onMounted(async () => {
const res = await request.get('/admin/dashboard')
Object.assign(data, res)
} catch (e) {
//
ElMessage.error('加载数据失败')
} finally {
loading.value = false
}

View File

@ -80,7 +80,7 @@ async function handleLogin() {
ElMessage.success('登录成功')
router.push('/')
} catch {
//
ElMessage.error('登录失败,请检查用户名和密码')
} finally {
loading.value = false
}

View File

@ -47,6 +47,12 @@
<template v-else-if="row.status === 'WaitConfirm'">
<span style="color: #e6a23c">等待用户确认收款</span>
</template>
<template v-else-if="row.status === 'Rejected'">
<el-tooltip v-if="row.rejectReason" :content="row.rejectReason" placement="top">
<span style="color: #f56c6c; cursor: pointer">拒绝{{ row.rejectReason }}</span>
</el-tooltip>
<span v-else style="color: #999">已拒绝</span>
</template>
<template v-else>
<span style="color: #999">已处理</span>
</template>
@ -99,7 +105,7 @@ async function handleAction(row, action) {
} catch (e) {
if (e !== 'cancel' && e?.toString() !== 'cancel') {
const data = e?.response?.data
const msg = data?.detail ? `${data.message}${data.detail}` : (data?.message || '操作失败')
const msg = data?.message || '操作失败'
ElMessage.error({ message: msg, duration: 5000 })
}
}
@ -115,8 +121,8 @@ function statusTagType(s) {
function formatTime(str) {
if (!str) return '-'
// UTCUTC
const d = new Date(typeof str === 'string' && !str.endsWith('Z') ? str + 'Z' : str)
// UTC Z UTC
const d = new Date(typeof str === 'string' && !str.endsWith('Z') && !str.includes('+') ? str + 'Z' : str)
const pad = n => String(n).padStart(2, '0')
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} ${pad(d.getHours())}:${pad(d.getMinutes())}`
}

View File

@ -210,6 +210,7 @@ public static class EarningEndpoints
w.Amount,
PaymentMethod = w.PaymentMethod.ToString(),
Status = w.Status.ToString(),
w.RejectReason,
w.CreatedAt,
w.ProcessedAt
})