feat: 全量落地后端与功能闭环

- 真实后端(server/):SQLite 存储 + scrypt 会话鉴权 + SMTP 邮件
  - auth 注册/登录/登出/me/资料更新
  - contact 联系表单(落库+邮件)、newsletter 订阅(去重)
  - favorites 作品收藏、comments 新闻评论、account 管理收件箱
- 用户系统 UI:个人中心 /account(资料/收藏/评论/管理员面板)、
  收藏按钮、评论组件、登录/注册弹窗接真实 API(useApiError 错误映射)
- 内容单点事实源:app/data/news|work 消除三处重复,页面全部引用
- 修复断链:首页动态/作品卡可点击、分享按钮真实动作、移除 # 死链、
  语言切换器、社交链接统一 siteConfig
- SEO:动态 sitemap/robots、JSON-LD、脚本生成真实 og-image.png
- 列表增强:搜索 + 加载更多
- 部署自动化:build-and-push.sh 支持 git tag 版本化镜像;
  deploy.sh 一条命令构建推送+注入 Secret/ConfigMap+kubectl 滚动升级;
  deployment 挂 PVC 持久化;Dockerfile 支持 better-sqlite3 原生编译
- 组件注册去目录前缀,修复 AppLoader/AnimatedButton 等未渲染问题
This commit is contained in:
2026-08-06 15:00:56 +08:00
parent 6192ae0a38
commit 5c3f3bca63
61 changed files with 3408 additions and 1318 deletions
+10 -36
View File
@@ -139,7 +139,7 @@
</div>
<div>
<h3 class="text-base md:text-lg font-bold text-gray-900 mb-2">Email</h3>
<a href="mailto:chenchun@virtheart.com" class="text-sm md:text-base text-gray-600 hover:text-black transition-colors duration-300">
<a :href="`mailto:${siteConfig.email}`" class="text-sm md:text-base text-gray-600 hover:text-black transition-colors duration-300">
{{ t('contact.info.email') }}
</a>
</div>
@@ -198,6 +198,7 @@ import { useI18n } from 'vue-i18n'
import { useSeoMeta } from '#imports'
import gsap from 'gsap'
import { useAppStore } from '~/stores/app'
import { siteConfig } from '~/config/site'
const { t } = useI18n()
const appStore = useAppStore()
@@ -234,16 +235,8 @@ const handleSubmit = async () => {
statusMessage.value = ''
try {
// 模拟 API 调用 - 你需要替换为真实的邮件服务
// 可选方案:
// 1. 使用 Nuxt server API: await $fetch('/api/contact', { method: 'POST', body: form })
// 2. 使用 Formspree: await fetch('https://formspree.io/f/YOUR_ID', { ... })
// 3. 使用 EmailJS 等第三方服务
await new Promise(resolve => setTimeout(resolve, 1500)) // 模拟网络延迟
// 模拟成功
console.log('Form submitted:', form)
// 真实提交到后端(落库 + 尽力发送邮件)
await $fetch('/api/contact', { method: 'POST', body: { ...form } })
submitStatus.value = 'success'
statusMessage.value = t('contact.form.successMessage') || 'Message sent successfully! We will get back to you soon.'
@@ -253,16 +246,17 @@ const handleSubmit = async () => {
form[key as keyof typeof form] = ''
})
// 3秒后重置状态
// 4秒后重置状态
setTimeout(() => {
submitStatus.value = 'idle'
statusMessage.value = ''
}, 3000)
}, 4000)
} catch (error) {
console.error('Form submission error:', error)
submitStatus.value = 'error'
statusMessage.value = t('contact.form.errorMessage') || 'Failed to send message. Please try again or contact us directly.'
// 如实展示后端错误
statusMessage.value = (error as any)?.data?.message || t('contact.form.errorMessage') || 'Failed to send message. Please try again or contact us directly.'
} finally {
isSubmitting.value = false
}
@@ -362,28 +356,8 @@ interface SocialLink {
url: string
}
const socials: SocialLink[] = [
{
name: 'Twitter',
icon: 'ph:x-logo',
url: 'https://twitter.com'
},
{
name: 'Instagram',
icon: 'ph:instagram-logo',
url: 'https://instagram.com'
},
{
name: 'LinkedIn',
icon: 'ph:linkedin-logo',
url: 'https://linkedin.com'
},
{
name: 'GitHub',
icon: 'ph:github-logo',
url: 'https://github.com'
}
]
// 社交链接统一取自站点配置(单一事实源)
const socials: SocialLink[] = siteConfig.socials
</script>
<style scoped>