feat: prompt/confirm 替换为自定义弹窗

- shared/utils.js 新增 showConfirm()/showPrompt() 通用函数(inline CSS,无需额外样式)
- admin/common.js 移除重复 showConfirm(),统一使用 utils.js
- admin/posts.js: 3 处 confirm/prompt 替换(审核/退回/锁定)
- admin/comments.js: 1 处 confirm 替换
- settings/index.html: 4 处 confirm + 1 处 prompt 替换
- studio/posts.html + drafts.html: 3 处 confirm 替换
- post-view.js + login.js + post-favorite.js: 3 处 confirm 替换
This commit is contained in:
2026-06-02 20:11:48 +08:00
parent 2e6e7fc057
commit c73b131b83
10 changed files with 318 additions and 243 deletions

View File

@ -95,9 +95,9 @@
loginInProgress = false;
submitBtn.disabled = false;
submitBtn.textContent = '登录';
if (confirm(resp.message + '\n\n确认登录将撤销注销并恢复账号。')) {
doConfirmRestore(email, password);
}
showConfirm('确认', resp.message + '\n\n确认登录将撤销注销并恢复账号。').then(function(ok) {
if (ok) doConfirmRestore(email, password);
});
} else if (xhr.status === 200 && resp && resp.success) {
window.MetaLab.toast(toast, '登录成功', false);
setTimeout(function () {