Jelajahi Sumber

修改文案

lex 1 tahun lalu
induk
melakukan
ebdf2a0a22
2 mengubah file dengan 13 tambahan dan 2 penghapusan
  1. 12 1
      src/router/router-guards.ts
  2. 1 1
      src/views/attend-class/index.tsx

+ 12 - 1
src/router/router-guards.ts

@@ -28,7 +28,18 @@ export function createRouterGuards(router: Router) {
   router.beforeEach(async (to, from, next) => {
     // console.log(to, '修改标题');
     // console.log('access token');
-    document.title = to.meta.title ? to.meta.title : ('音乐数字课堂' as string);
+    if (to.path === '/attend-class') {
+      let title = to.meta.title;
+      if (to.query.type === 'preview') {
+        title = '预览';
+      }
+      document.title = title ? title : ('音乐数字课堂' as string);
+    } else {
+      document.title = to.meta.title
+        ? to.meta.title
+        : ('音乐数字课堂' as string);
+    }
+
     if ('serviceWorker' in navigator) {
       console.log(caches.keys(), 'caches.keys()');
       caches.keys().then(function (cacheNames) {

+ 1 - 1
src/views/attend-class/index.tsx

@@ -1212,7 +1212,7 @@ export default defineComponent({
                   });
                   if (res.data.rows && res.data.rows.length) {
                     data.modalAttendMessage =
-                      '本节课已设置课后训练,是否布置?';
+                      '本节课已设置课后作业,是否布置?';
                   }
                   data.modelAttendStatus = true;
                 }}>