后台统一状态提示:共享 toast 模块(ToastStack 挂后台布局与登录页),登录成功/失败、文章/标签/作品/文件/评论/设置操作全部有反馈,替换掉原生 alert;编辑器局部 toast 并入共享实现

This commit is contained in:
Sakurasan
2026-09-28 23:52:16 +08:00
parent f7a2e83727
commit c84a383e5c
11 changed files with 96 additions and 45 deletions
+3
View File
@@ -1,5 +1,6 @@
<script setup>
import { computed, onMounted, ref } from 'vue'
import { toastOk, toastErr } from './toast'
import { adminApi } from '../api'
import { SKIN_CONSTANTS, UI_CONSTANTS } from '../site'
import { SECTIONS } from '../ui/sections'
@@ -186,7 +187,9 @@ async function save() {
}
}
savedAt.value = new Date().toLocaleTimeString('zh-CN', { hour12: false })
toastOk('设置已保存')
} catch (e) {
toastErr('保存失败:' + (e.message || ''))
error.value = e.message || '保存失败'
} finally {
saving.value = false