Переглянути джерело

Merge branch 'iteration-20240731' into jenkins

lex 9 місяців тому
батько
коміт
20300c0594
3 змінених файлів з 14 додано та 15 видалено
  1. 1 3
      src/App.tsx
  2. 12 11
      src/views/notation/index.tsx
  3. 1 1
      vite.config.ts

+ 1 - 3
src/App.tsx

@@ -3,7 +3,7 @@ import { NConfigProvider, zhCN, dateZhCN, NModal } from 'naive-ui';
 import { AppProvider } from './components/Application';
 import { RouterView, useRouter } from 'vue-router';
 import setting from './settings/designSetting';
-import { eventGlobal, lighten } from './utils';
+import { lighten } from './utils';
 import RouterError from './components/RouterError';
 import { useRegisterSW } from 'virtual:pwa-register/vue';
 import { useUserStore } from './store/modules/users';
@@ -167,8 +167,6 @@ export default defineComponent({
           : '';
         userStore.logout();
         history.go(0);
-      } else if (e.data?.api === 'onAuthNotInstalled') {
-        eventGlobal.emit('auth-not-installed');
       }
     };
 

+ 12 - 11
src/views/notation/index.tsx

@@ -1,15 +1,16 @@
-import { defineComponent, onMounted, onUnmounted, reactive, ref } from 'vue';
+import { defineComponent, onMounted, onUnmounted, ref } from 'vue';
 import { useUserStore } from '/src/store/modules/users';
 import styles from './index.module.less';
 import { modalClickMask, state } from '/src/state';
 import { NButton, NModal, NSpace, NSpin } from 'naive-ui';
-import { exitFullscreen, iframeDislableKeyboard } from '/src/utils';
+import { eventGlobal } from '/src/utils';
 import { useRouter } from 'vue-router';
 export default defineComponent({
   name: 'notation-a',
   setup() {
     const router = useRouter();
     const show = ref(false);
+    const key = new Date().getTime();
     const previewModal = ref(false);
     const previewParams = ref({} as any);
     const removeVisiable = ref(false);
@@ -20,16 +21,16 @@ export default defineComponent({
     const notationOpenCreate = sessionStorage.getItem('notation-open-create');
     const openCreateUrl = notationOpenCreate == '1' ? '&addShow=1' : '';
     sessionStorage.removeItem('notation-open-create');
-    const data = reactive({
+    const data = {
       src: `${
         /(192|localhost)/.test(location.origin)
           ? // ?
-            'https://test.lexiaoya.cn'
-          : // 'http://localhost:3050'
-            location.origin
+            // 'https://test.lexiaoya.cn'
+            'http://localhost:3050'
+          : location.origin
       }/notation/?t=${Date.now()}#/create?v=${Date.now()}&Authorization=${Authorization}${openCreateUrl}`
       //   src: `http://localhost:3050/#/create?Authorization=${Authorization}`
-    });
+    };
     const fscreen = () => {
       const el = document.documentElement as any;
       //进入全屏
@@ -39,7 +40,6 @@ export default defineComponent({
         (el.msRequestFullscreen && el.msRequestFullscreen());
     };
     const handleOpen = (e: MessageEvent) => {
-      console.log(e.data, 'data');
       if (e.data.api === 'notation_open') {
         if (state.application) {
           show.value = true;
@@ -52,9 +52,10 @@ export default defineComponent({
           window.open(e.data.url);
         }
       } else if (e.data.api === 'notation_exit') {
-        console.log('进来');
-
         removeVisiable.value = true;
+      } else if (e.data.api === 'onAuthNotInstalled') {
+        //
+        eventGlobal.emit('auth-not-installed');
       }
     };
     onMounted(() => {
@@ -65,7 +66,7 @@ export default defineComponent({
     });
     return () => (
       <div class={styles.wrap}>
-        <iframe ref={iframeRef} src={data.src} key={Date.now()}></iframe>
+        <iframe ref={iframeRef} src={data.src} key={key}></iframe>
 
         <NModal
           maskClosable={modalClickMask}

+ 1 - 1
vite.config.ts

@@ -24,7 +24,7 @@ function resolve(dir: string) {
 // https://vitejs.dev/config/
 // https://github.com/vitejs/vite/issues/1930 .env
 // const proxyUrl = 'https://dev.kt.colexiu.com/';
-const proxyUrl = 'https://dev.kt.colexiu.com';
+const proxyUrl = 'https://test.kt.colexiu.com';
 // const proxyUrl = 'http://192.168.3.14:7989';
 const now = new Date().getTime();
 export default defineConfig(() => {