diff --git a/src/common/educoder.js b/src/common/educoder.js
index 7b14824ac..6575c5032 100644
--- a/src/common/educoder.js
+++ b/src/common/educoder.js
@@ -7,7 +7,7 @@ export {
getImageUrl as getImageUrl,getImageUrlAbsolute as getImageUrlAbsolute,getImage as getImage, getmyUrl as getmyUrl, getRandomNumber as getRandomNumber, getUrl as getUrl, getZoneUrl as getZoneUrl, publicSearchs as publicSearchs, getRandomcode as getRandomcode, getUrlmys as getUrlmys, getUrl2 as getUrl2, setImagesUrl as setImagesUrl
, getUploadActionUrl as getUploadActionUrl, getUploadActionUrltwo as getUploadActionUrltwo, getUploadActionUrlthree as getUploadActionUrlthree, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth
, getTaskUrlById as getTaskUrlById, TEST_HOST, htmlEncode as htmlEncode, getupload_git_file as getupload_git_file, getcdnImageUrl as getcdnImageUrl,
- turnbar,returnbar,setSeoMeta as setSeoMeta , IsPC as IsPC
+ turnbar,returnbar,setSeoMeta as setSeoMeta , IsPC as IsPC, addMeta as addMeta
} from './UrlTool';
export { setmiyah as setmiyah } from './Component';
diff --git a/src/forge/Information/Pages/newsDetail.jsx b/src/forge/Information/Pages/newsDetail.jsx
index 50e587674..b98da833a 100644
--- a/src/forge/Information/Pages/newsDetail.jsx
+++ b/src/forge/Information/Pages/newsDetail.jsx
@@ -7,7 +7,7 @@ import { getNewsDetail } from '../api';
import { IsPC } from 'educoder';
import { tempConfig } from '../tempInfo';
import Acce from '../Component/mobile/accessory';
-
+import { addMeta, setSeoMeta } from 'educoder';
function NewsDetail(props){
@@ -44,6 +44,21 @@ function NewsDetail(props){
}
},[id])
+ useEffect(()=>{
+ // 设置网页标题
+ if(detail){
+ const { name, cmsDir, summary} = detail;
+ document.title = `${ name }/${ cmsDir.name }`;
+ addMeta('Keywords', `${ name },${ cmsDir.name },${ summary }`);
+ }
+ return componentWillUnmount
+ }, [detail])
+
+ function componentWillUnmount() {
+ document.title= zonedetail.name;
+ setSeoMeta(`${zonedetail.name},`, zonedetail.name, zonedetail.subTitle, `/zone/${deptId}`)
+ }
+
function getDetails(){
setIsSpin(true)
getNewsDetail(id).then(result=>{
diff --git a/src/forge/Information/Pages/sourceDetail.jsx b/src/forge/Information/Pages/sourceDetail.jsx
index d94f85362..9b06fa4c0 100644
--- a/src/forge/Information/Pages/sourceDetail.jsx
+++ b/src/forge/Information/Pages/sourceDetail.jsx
@@ -9,11 +9,13 @@ import { Base64 } from 'js-base64';
import { httpUrl } from '../fetch';
import { AlignCenter, FlexAJ } from '../../Component/layout';
import SourceIcon from '../img/sourceIcon.png';
+import { addMeta, setSeoMeta } from 'educoder';
function SourceDetail(props){
const { deptId , sourceid } = props.match.params;
const [ detail , setDetail ] = useState(undefined);
+ const zonedetail = props.data;
useEffect(()=>{
if(sourceid){
@@ -21,6 +23,21 @@ function SourceDetail(props){
}
},[sourceid])
+ useEffect(()=>{
+ // 设置网页标题
+ if(detail){
+ const { name, domainName, summary} = detail;
+ document.title = `${ name }/${ domainName }`;
+ addMeta('Keywords', `${ name },${ domainName },${ summary }`);
+ }
+ return componentWillUnmount
+ }, [detail])
+
+ function componentWillUnmount() {
+ document.title= zonedetail.name;
+ setSeoMeta(`${zonedetail.name},`, zonedetail.name, zonedetail.subTitle, `/zone/${deptId}`)
+ }
+
function getDetails(){
getSourceDetail(sourceid).then(response=>{
if(response){
diff --git a/src/forge/Information/index.jsx b/src/forge/Information/index.jsx
index 121f17554..e8b70855e 100644
--- a/src/forge/Information/index.jsx
+++ b/src/forge/Information/index.jsx
@@ -16,6 +16,8 @@ import "slick-carousel/slick/slick.css";
import "slick-carousel/slick/slick-theme.css";
import { tempEnum } from "./tempInfo";
import { ImageLayerOfCommentHOC } from "../../modules/page/layers/ImageLayerOfCommentHOC";
+import { setSeoMeta } from 'educoder';
+
const SourceDetail = Loadable({
loader: () => import("./Pages/sourceDetail"),
@@ -127,6 +129,7 @@ function Index(props){
getAdminUrl(data.id);
getRole(data.id)
}
+ setSeoMeta(`${data.name},`, data.name, data.subTitle, `/zone/${deptId}`)
}
}).catch(console.error())
}
@@ -204,7 +207,7 @@ function Index(props){
(
-
+
)}
>