feat: 收官补齐全部未实现功能
- 账号体系:修改密码(/account + PATCH /api/auth/password)、自助删除账号 (DELETE /api/auth/me)、订阅退订(token + /unsubscribe 页) - 前台/SEO:RSS 订阅 /feed.xml、作品详情分享、canonical URL、 文章 Article JSON-LD、品牌化错误页(i18n) - 后台增强:图片管理 /admin/uploads、操作审计日志 /admin/audit(含清空)、 联系消息已读标记、评论列表分页 - 工程:vitest 测试(密码哈希/内容校验器/种子完整性,12 例)+ pnpm test - DB 迁移:contacts.read、subscribers.token、audit_logs(老库 ALTER 兼容) - 密码逻辑抽为 server/utils/password.ts 供测试
This commit is contained in:
+14
-13
@@ -1,30 +1,31 @@
|
||||
<script setup lang="ts">
|
||||
import type { NuxtError } from '#app'
|
||||
import { computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
const props = defineProps<{ error: NuxtError }>()
|
||||
const { t } = useI18n()
|
||||
|
||||
const statusText = computed(() => props.error.statusText || 'Something went wrong.')
|
||||
const statusText = computed(() => {
|
||||
if (props.error.statusCode === 404) return t('error.notFound')
|
||||
if (props.error.statusCode === 500) return t('error.serverError')
|
||||
return t('error.generic')
|
||||
})
|
||||
|
||||
const handleError = () => clearError({ redirect: '/' })
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex min-h-screen flex-col items-center justify-center gap-4 bg-slate-950 px-6 text-center text-slate-50">
|
||||
<p class="text-sm font-medium uppercase tracking-[0.35em] text-cyan-300">
|
||||
Error occurred in this page
|
||||
</p>
|
||||
<h1 class="text-6xl font-semibold">
|
||||
{{ error.status }}
|
||||
</h1>
|
||||
<p class="max-w-xl text-slate-300">
|
||||
{{ statusText }}
|
||||
</p>
|
||||
<div class="flex min-h-screen flex-col items-center justify-center gap-6 bg-white px-6 text-center">
|
||||
<p class="text-sm font-semibold uppercase tracking-[0.35em] text-gray-400">{{ t('error.title') }}</p>
|
||||
<h1 class="text-7xl font-bold text-black">{{ error.statusCode }}</h1>
|
||||
<p class="max-w-xl text-gray-500">{{ statusText }}</p>
|
||||
<button
|
||||
class="rounded-md bg-cyan-300 px-5 py-3 text-sm font-semibold text-slate-950 transition hover:bg-cyan-200"
|
||||
class="rounded-full bg-black px-8 py-3 text-sm font-semibold text-white transition-colors hover:bg-gray-800"
|
||||
type="button"
|
||||
@click="handleError"
|
||||
>
|
||||
Go back home
|
||||
{{ t('error.backHome') }}
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user