首页标题加载优化

This commit is contained in:
禺狨 2023-04-04 09:56:54 +08:00
parent 2bd10f5a6f
commit 5cea8d06fc
2 changed files with 5 additions and 0 deletions

View File

@ -25,6 +25,7 @@ const CoursePage = () => {
setLoading(true); setLoading(true);
Course.detail(Number(params.courseId)) Course.detail(Number(params.courseId))
.then((res: any) => { .then((res: any) => {
document.title = res.data.course.title;
setCourse(res.data.course); setCourse(res.data.course);
setChapters(res.data.chapters); setChapters(res.data.chapters);
setHours(res.data.hours); setHours(res.data.hours);

View File

@ -31,6 +31,10 @@ const IndexPage = () => {
getData(); getData();
}, [tabKey, currentDepId]); }, [tabKey, currentDepId]);
useEffect(() => {
document.title = systemConfig.systemName;
}, [systemConfig]);
const getData = () => { const getData = () => {
setLoading(true); setLoading(true);
user.courses(currentDepId).then((res: any) => { user.courses(currentDepId).then((res: any) => {