|
@@ -9,9 +9,15 @@ import { defineComponent } from "vue";
|
|
|
export default defineComponent(() => {
|
|
|
const editor = initEditor();
|
|
|
const resource = useResource();
|
|
|
- resource.controls.categoryCtrl.init();
|
|
|
const auth = useAuth();
|
|
|
|
|
|
+ resource.controls.categoryCtrl.getUserCate().then(() => {
|
|
|
+ const categories = resource.controls.categoryCtrl.state.categories;
|
|
|
+ const list: any = categories.find((d: any) => d.type == "h5");
|
|
|
+ const res = list?.children.find((e: any) => e.name == "平台");
|
|
|
+ editor.store.setTplCategory(res?.children);
|
|
|
+ });
|
|
|
+
|
|
|
const params = new URLSearchParams(location.hash.split("?")[1]);
|
|
|
editor.actions.switchMode((params.get("mode") || "editPage") as EditorMode);
|
|
|
const prodId = params.get("id");
|
|
@@ -24,10 +30,6 @@ export default defineComponent(() => {
|
|
|
editor.actions.initWkDesign(prodId);
|
|
|
return;
|
|
|
}
|
|
|
- const categories = resource.controls.categoryCtrl.state.categories;
|
|
|
- const list: any = categories.find((d: any) => d.type == "h5");
|
|
|
- const res = list?.children.find((e: any) => e.name == "平台");
|
|
|
- editor.store.setTplCategory(res?.children);
|
|
|
editor.actions.initDesign(prodId, isSys);
|
|
|
} else {
|
|
|
editor.jumpIndexHtml();
|