liushengqiang 1 年間 前
コミット
75b6d44b87

+ 2 - 2
dev-dist/sw.js

@@ -67,7 +67,7 @@ if (!self.define) {
     });
   };
 }
-define(['./workbox-5357ef54'], (function (workbox) { 'use strict';
+define(['./workbox-ab7aa862'], (function (workbox) { 'use strict';
 
   self.skipWaiting();
   workbox.clientsClaim();
@@ -82,7 +82,7 @@ define(['./workbox-5357ef54'], (function (workbox) { 'use strict';
     "revision": "3ca0b8505b4bec776b69afdba2768812"
   }, {
     "url": "index.html",
-    "revision": "0.2qdsoqsio4o"
+    "revision": "0.h3pd2134s4o"
   }], {});
   workbox.cleanupOutdatedCaches();
   workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {

+ 10 - 2
src/components/layout/layoutSilder.tsx

@@ -93,12 +93,20 @@ export default defineComponent({
       },
       {
         activeIcon: setIcon,
-        name: '设置',
+        name: '创作',
         normalIcon: setNormal,
         isActive: false,
         id: 8,
-        path: '/setting'
+        path: '/notation'
       }
+      // {
+      //   activeIcon: setIcon,
+      //   name: '设置',
+      //   normalIcon: setNormal,
+      //   isActive: false,
+      //   id: 8,
+      //   path: '/setting'
+      // }
     ]);
     const checkNavBar = (item: any) => {
       itemInfoList.forEach((now: any) => {

+ 8 - 0
src/router/routes/index.ts

@@ -139,6 +139,14 @@ export const constantRoutes: RouteRecordRaw[] = [
         meta: {
           title: '资源'
         }
+      },
+      {
+        path: '/notation',
+        name: 'notation',
+        component: () => import('@/views/notation/index'),
+        meta: {
+          title: '创作'
+        }
       }
     ]
   },

+ 11 - 0
src/views/notation/index.module.less

@@ -0,0 +1,11 @@
+.wrap{
+    width: 100%;
+    height: 100%;
+    background-color: #fff;
+    border-radius: 15px;
+    iframe{
+        width: 100%;
+        height: 100%;
+        border: none;
+    }
+}

+ 29 - 0
src/views/notation/index.tsx

@@ -0,0 +1,29 @@
+import { defineComponent, onMounted, reactive } from 'vue';
+import { useUserStore } from '/src/store/modules/users';
+import styles from './index.module.less';
+
+export default defineComponent({
+  name: 'notation-a',
+  setup() {
+    const userStore = useUserStore();
+    const Authorization = userStore.getToken || '';
+    console.log(Authorization);
+    const data = reactive({
+      src: `${location.origin}/notation/#/create?Authorization=${Authorization}`
+      //   src: `http://localhost:3050/#/create?Authorization=${Authorization}`
+    });
+    const handleOpen = (e: MessageEvent) => {
+      if (e.data.api === 'notation_open') {
+        window.open(e.data.url);
+      }
+    };
+    onMounted(() => {
+      window.addEventListener('message', handleOpen);
+    });
+    return () => (
+      <div class={styles.wrap}>
+        <iframe src={data.src}></iframe>
+      </div>
+    );
+  }
+});