Browse Source

Merge branch 'edev' into dev

qinyan 1 năm trước cách đây
mục cha
commit
8f70762970

+ 10 - 1
src/modules/editor/components/Viewport/Header/ShareBox.tsx

@@ -1,5 +1,6 @@
 import { useEditor } from "@/modules/editor";
 import { clipboard } from "@/utils";
+import { useAuth } from "@queenjs-modules/auth";
 import { useQRCode } from "@vueuse/integrations/useQRCode";
 import { Button } from "ant-design-vue";
 import { defineComponent } from "vue";
@@ -7,7 +8,15 @@ import { defineComponent } from "vue";
 export const ShareBox = defineComponent({
   setup() {
     const { store } = useEditor();
-    let shareLink = location.origin + "/share.html?id=" + store.designData._id;
+    const auth = useAuth();
+    const userInfo: any = auth.store.userInfo;
+    const isSys = userInfo.roles?.includes("system") ? true : false;
+    let shareLink =
+      location.origin +
+      "/share.html?id=" +
+      store.designData._id +
+      "&isSys=" +
+      isSys;
     // if (location.host == "www.infish.cn") {
     //   shareLink =
     //     location.origin +

+ 1 - 1
src/pages/editor/EditPage/index.tsx

@@ -17,7 +17,7 @@ export default defineComponent(() => {
   auth.actions.on("getUserInfo:success", () => {
     if (prodId) {
       const userInfo: any = auth.store.userInfo;
-      const isSys = userInfo.roles?.includes("system");
+      const isSys = userInfo.roles?.includes("system") ? true : false;
       editor.actions.initDesign(prodId, isSys);
     } else {
       editor.jumpIndexHtml();

+ 2 - 1
src/pages/h5/share/Promotion.tsx

@@ -6,11 +6,12 @@ export default defineComponent(() => {
   const editor = initEditor();
   const params = new URLSearchParams(location.href.split("?")[1]);
   const id = params.get("id");
+  const isSys = params.get("isSys");
 
   editor.actions.switchMode("preview");
 
   if (id) {
-    editor.actions.initDesign(id);
+    editor.actions.initDesign(id, isSys?.split("#")[0]);
     editor.controls.wxCtrl.setup(window.location.href);
 
     editor.actions.on("initDesign:success", () => {

+ 10 - 1
src/pages/website/Promotion2/components/ShareModal.tsx

@@ -1,6 +1,7 @@
 import { IconWechat } from "@/assets/icons";
 import { PromotionController } from "@/modules/resource/controllers/PromotionController";
 import { clipboard } from "@/utils";
+import { useAuth } from "@queenjs-modules/auth";
 import { Image } from "@queenjs/ui";
 import { useQRCode } from "@vueuse/integrations/useQRCode";
 import { Button, Divider, Input } from "ant-design-vue";
@@ -13,7 +14,15 @@ export default defineComponent({
     controller: any<PromotionController>().isRequired,
   },
   setup(props, { slots }) {
-    let shareLink = location.origin + "/share.html?id=" + props.record._id;
+    const auth = useAuth();
+    const userInfo: any = auth.store.userInfo;
+    const isSys = userInfo.roles?.includes("system") ? true : false;
+    let shareLink =
+      location.origin +
+      "/share.html?id=" +
+      props.record._id +
+      "&isSys=" +
+      isSys;
     // if (location.host == "www.infish.cn") {
     //   shareLink =
     //     location.origin +

+ 1 - 1
src/pages/website/Promotion2/controller.tsx

@@ -37,7 +37,7 @@ export function createPromotinController(
 
   async function sharePromotion(record: any) {
     const userInfo: any = auth.store.userInfo;
-    const isSys = userInfo.roles?.includes("system");
+    const isSys = userInfo.roles?.includes("system") ? true : false;
     await editor.actions.initDesign(record._id, isSys);
     editor.actions.switchMode("preview");
     resource.showModal(

+ 1 - 1
vue.config.js

@@ -18,7 +18,7 @@ module.exports = defineConfig({
     index: "src/pages/website/index.ts",
     editor: "src/pages/editor/index.ts",
     share: "src/pages/h5/share/index.ts",
-    // stat: "src/pages/h5/statistics/index.ts",
+    stat: "src/pages/h5/statistics/index.ts",
     treeapi: "src/pages/queentree/index.ts",
   },
   publicPath: publicPath,