From e8d37e5f4eebf5dabfd5b1bbbf0e63ab1592da87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=BF=83=E5=AE=87?= Date: Thu, 21 Sep 2023 16:30:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Information/Pages/newsDetail.jsx | 6 ++++-- src/forge/Information/Pages/sourceDetail.jsx | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/forge/Information/Pages/newsDetail.jsx b/src/forge/Information/Pages/newsDetail.jsx index b98da833..025f1659 100644 --- a/src/forge/Information/Pages/newsDetail.jsx +++ b/src/forge/Information/Pages/newsDetail.jsx @@ -55,8 +55,10 @@ function NewsDetail(props){ }, [detail]) function componentWillUnmount() { - document.title= zonedetail.name; - setSeoMeta(`${zonedetail.name},`, zonedetail.name, zonedetail.subTitle, `/zone/${deptId}`) + if (zonedetail) { + document.title= zonedetail.name; + setSeoMeta(`${zonedetail.name},`, zonedetail.name, zonedetail.subTitle, `/zone/${deptId}`) + } } function getDetails(){ diff --git a/src/forge/Information/Pages/sourceDetail.jsx b/src/forge/Information/Pages/sourceDetail.jsx index 9b06fa4c..cd50906f 100644 --- a/src/forge/Information/Pages/sourceDetail.jsx +++ b/src/forge/Information/Pages/sourceDetail.jsx @@ -34,8 +34,10 @@ function SourceDetail(props){ }, [detail]) function componentWillUnmount() { - document.title= zonedetail.name; - setSeoMeta(`${zonedetail.name},`, zonedetail.name, zonedetail.subTitle, `/zone/${deptId}`) + if (zonedetail) { + document.title= zonedetail.name; + setSeoMeta(`${zonedetail.name},`, zonedetail.name, zonedetail.subTitle, `/zone/${deptId}`) + } } function getDetails(){