feat(hjc-web): 为登录/注册/找回密码等 7 个页面补 title 标签

这些页面未调用 usePageSeo,SSR 产物里没有 <title>,浏览器标签页显示 URL。

- login / register / forgot-password / change-password / buy / renewal / preview
  统一按 contact.vue 的既有写法:await fetchSiteInfo() 后调 usePageSeo,
  标题自动带上站点品牌后缀
- preview 页仅供内部调试,追加 robots: noindex,nofollow 避免被收录
- cases.vue 是 /cases → /case 的纯重定向壳,无需标题,未改动
This commit is contained in:
2026-09-19 02:05:10 +08:00
parent de412297fb
commit a6b65ae918
7 changed files with 89 additions and 0 deletions
+12
View File
@@ -11,6 +11,18 @@
*/ */
const route = useRoute() const route = useRoute()
const { loadTemplate } = useTemplate() const { loadTemplate } = useTemplate()
const { siteInfo, fetchSiteInfo } = useSite()
// 先取站点信息,保证标题能带上品牌名(与其它页面一致)
await fetchSiteInfo()
usePageSeo(
{
title: '购买标书',
path: '/buy'
},
siteInfo.value
)
const pageComponent = shallowRef<Component | null>(null) const pageComponent = shallowRef<Component | null>(null)
const components = await loadTemplate() const components = await loadTemplate()
+12
View File
@@ -75,6 +75,18 @@
<script setup lang="ts"> <script setup lang="ts">
const { sendChangePasswordSms, changePassword } = useHjcPassword() const { sendChangePasswordSms, changePassword } = useHjcPassword()
const { isLoggedIn, logout } = useHjcAuth() const { isLoggedIn, logout } = useHjcAuth()
const { siteInfo, fetchSiteInfo } = useSite()
// 先取站点信息,保证标题能带上品牌名(与其它页面一致)
await fetchSiteInfo()
usePageSeo(
{
title: '修改密码',
path: '/change-password'
},
siteInfo.value
)
const PASSWORD_PATTERN = /^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d@$!%*#?&]{8,}$/ const PASSWORD_PATTERN = /^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d@$!%*#?&]{8,}$/
const SMS_COUNTDOWN_SECONDS = 60 const SMS_COUNTDOWN_SECONDS = 60
+12
View File
@@ -141,6 +141,18 @@
import type { HjcPasswordApplyStatus } from '~/composables/useHjcPassword' import type { HjcPasswordApplyStatus } from '~/composables/useHjcPassword'
const { applyPasswordReset, fetchApplyStatus } = useHjcPassword() const { applyPasswordReset, fetchApplyStatus } = useHjcPassword()
const { siteInfo, fetchSiteInfo } = useSite()
// 先取站点信息,保证标题能带上品牌名(与其它页面一致)
await fetchSiteInfo()
usePageSeo(
{
title: '忘记密码',
path: '/forgot-password'
},
siteInfo.value
)
/** 密码强度:与后端(核心实例)一致,先在前端挡一道,免得提交后才被拒 */ /** 密码强度:与后端(核心实例)一致,先在前端挡一道,免得提交后才被拒 */
const PASSWORD_PATTERN = /^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d@$!%*#?&]{8,}$/ const PASSWORD_PATTERN = /^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d@$!%*#?&]{8,}$/
+13
View File
@@ -56,7 +56,20 @@
<script setup lang="ts"> <script setup lang="ts">
const { login, fetchCaptcha } = useHjcAuth() const { login, fetchCaptcha } = useHjcAuth()
const { siteInfo, fetchSiteInfo } = useSite()
const route = useRoute() const route = useRoute()
// 先取站点信息,保证标题能带上品牌名(与其它页面一致)
await fetchSiteInfo()
usePageSeo(
{
title: '企业登录',
path: '/login'
},
siteInfo.value
)
const enterpriseName = ref('') const enterpriseName = ref('')
const password = ref('') const password = ref('')
/** 图形验证码(后端只下发图片,答案由用户肉眼识别后输入) */ /** 图形验证码(后端只下发图片,答案由用户肉眼识别后输入) */
+15
View File
@@ -13,6 +13,21 @@ const route = useRoute()
const previewTemplateId = route.query.templateId as string const previewTemplateId = route.query.templateId as string
const { loadTemplate, registerTemplate } = useTemplate() const { loadTemplate, registerTemplate } = useTemplate()
const { siteInfo, fetchSiteInfo } = useSite()
// 先取站点信息,保证标题能带上品牌名(与其它页面一致)
await fetchSiteInfo()
usePageSeo(
{
title: '模板预览',
path: '/preview'
},
siteInfo.value
)
// 预览页仅供内部调试,不希望被搜索引擎收录
useSeoMeta({ robots: 'noindex, nofollow' })
// 注册所有模板 // 注册所有模板
const templates = await import('~/templates') const templates = await import('~/templates')
+13
View File
@@ -58,7 +58,20 @@
<script setup lang="ts"> <script setup lang="ts">
const { register, sendSms } = useHjcAuth() const { register, sendSms } = useHjcAuth()
const { siteInfo, fetchSiteInfo } = useSite()
const route = useRoute() const route = useRoute()
// 先取站点信息,保证标题能带上品牌名(与其它页面一致)
await fetchSiteInfo()
usePageSeo(
{
title: '企业注册',
path: '/register'
},
siteInfo.value
)
const loading = ref(false) const loading = ref(false)
const error = ref('') const error = ref('')
const entForm = ref<any>(null) const entForm = ref<any>(null)
+12
View File
@@ -11,6 +11,18 @@
* 使用空白布局 * 使用空白布局
*/ */
const { loadTemplate } = useTemplate() const { loadTemplate } = useTemplate()
const { siteInfo, fetchSiteInfo } = useSite()
// 先取站点信息,保证标题能带上品牌名(与其它页面一致)
await fetchSiteInfo()
usePageSeo(
{
title: '服务续费',
path: '/renewal'
},
siteInfo.value
)
const pageComponent = shallowRef<Component | null>(null) const pageComponent = shallowRef<Component | null>(null)