ソースを参照

feat: sync offline

gemercheung 6 ヶ月 前
コミット
cfb90d86b7
1 ファイル変更4 行追加3 行削除
  1. 4 3
      src/model/app.vue

+ 4 - 3
src/model/app.vue

@@ -34,6 +34,7 @@ export const Model = defineComponent({
   setup() {
     const scene = computed(() => modelProps.type !== fuseModel && modelProps.type);
     const url = ref("");
+    const modelEntry = offline ? 'offline.html':'index.html'
     const setUrl = (newURL: string) => {
       if (newURL !== url.value) {
         setTimeout(() => {
@@ -61,10 +62,10 @@ export const Model = defineComponent({
       const urls = {
         [SceneType.SWKK]: `/swkk/spg.html?m=${scene.value.num}`,
         [SceneType.SWKJ]: `/swkk/spg.html?m=${scene.value.num}`,
-        [SceneType.SWSS]: `/swss/index.html?m=${scene.value.num}`,
+        [SceneType.SWSS]: `/swss/${modelEntry}?m=${scene.value.num}`,
         [SceneType.SWSSMX]: `/swkk/spg.html?m=${scene.value.num}`,
-        [SceneType.SWMX]: `index.html?caseId=${params.caseId}&app=${params.app}&modelId=${scene.value.num}&share=1#sign-model`,
-        [SceneType.SWYDSS]: `/swss/index.html?m=${scene.value.num}`,
+        [SceneType.SWMX]: `${modelEntry}?caseId=${params.caseId}&app=${params.app}&modelId=${scene.value.num}&share=1#sign-model`,
+        [SceneType.SWYDSS]: `/swss/${modelEntry}?m=${scene.value.num}`,
         [SceneType.SWYDMX]: `/swkk/spg.html?m=${scene.value.num}`,
       };
       setUrl(urls[type]);