bianjiang 1 жил өмнө
parent
commit
860e3dd30d

+ 9 - 0
src/modules/editor/module/actions/init.ts

@@ -2,6 +2,7 @@ import { useCtx } from "@/comm/ctx";
 import { EditorModule } from "..";
 import { DesignComp } from "../../objects/DesignTemp/DesignComp";
 import { EditorMode } from "../../typings";
+import { queenApi } from "queenjs";
 
 export const initActions = EditorModule.action({
   // 模块初始化
@@ -44,6 +45,14 @@ export const initActions = EditorModule.action({
     const ctx = useCtx();
     let ret = await ctx.prjCtrl.loadQueen5();
     if (!ret) {
+      if (location.href.indexOf("editor.html") == -1) {
+        const params = new URLSearchParams(location.search);
+        const projectPath = params.get("id") as string;
+        const url = `${location.origin}/editor.html?id=${projectPath}#/`;
+        location.href = url;
+        return false;
+      }
+
       ret = await this.actions.createLocalPromotion();
     }
     if (!ret.compMap) {