dusenyao 1 рік тому
батько
коміт
e2d2012143
1 змінених файлів з 13 додано та 8 видалено
  1. 13 8
      src/views/share/ShareExercise.vue

+ 13 - 8
src/views/share/ShareExercise.vue

@@ -4,6 +4,7 @@
 
 <script>
 import { GetShareRecordInfo } from '@/api/exercise';
+import { setItem } from '@/utils/storage';
 
 export default {
   name: 'ShareExercise',
@@ -30,14 +31,18 @@ export default {
     getShareRecordInfo() {
       GetShareRecordInfo({
         share_record_id: this.share_record_id,
-      }).then(({ share_record }) => {
-        if (share_record.access_popedom === 1) {
-          this.$router.push({ path: '/exercise', query: { id: share_record.exercise_id } });
-        }
-        if (share_record.access_popedom === 2) {
-          this.$router.push({ path: '/answer', query: { share_record_id: this.share_record_id } });
-        }
-      });
+      })
+        .then(({ share_record }) => {
+          if (share_record.access_popedom === 1) {
+            this.$router.push({ path: '/exercise', query: { id: share_record.exercise_id } });
+          }
+          if (share_record.access_popedom === 2) {
+            this.$router.push({ path: '/answer', query: { share_record_id: this.share_record_id } });
+          }
+        })
+        .catch(() => {
+          setItem('temporary_link', `GCLS-Exercise/#/open/share/exercise?share_record_id=${this.share_record_id}`);
+        });
     },
   },
 };