|
@@ -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>
|
|
|
+ );
|
|
|
+ }
|
|
|
+});
|