Files
bigscreenWeb/src/App.vue

51 lines
1.1 KiB
Vue
Raw Normal View History

2025-09-25 13:32:47 +08:00
<template>
<div class="app">
<router-view />
</div>
</template>
<script setup lang="ts">
import * as echarts from "echarts";
import { provide, onBeforeMount } from "vue";
provide("echarts", echarts);
import { useStore } from "vuex";
const store = useStore();
// 子页面https://child.com
window.addEventListener("message", (event) => {
console.log("🚀 ~ 传参了:");
// 2. 获取数据
const data = event.data;
if (data.username) {
// 调用token
window.sessionStorage.setItem("userInfo", JSON.stringify(data));
store.dispatch("loginAction", data);
}
});
// setTimeout(() => {
2025-10-11 09:54:24 +08:00
console.log("🚀 ~ import.meta.env.VITE_NAME:", import.meta.env.VITE_NAME)
2025-10-09 11:32:15 +08:00
if (import.meta.env.VITE_NAME == 'wuxi') {
store.dispatch("loginAction", {
username: "cdf",
password: "@#001njcnpqs",
});
}
2025-09-25 13:32:47 +08:00
// }, 100);
onBeforeMount(() => {
window.sessionStorage.setItem("token", "");
console.log("销毁页面了");
});
</script>
<style lang="less" scoped>
@import "@/assets/scss/element.scss";
2025-10-09 11:32:15 +08:00
2025-09-25 13:32:47 +08:00
.app {
width: 100vw;
height: 100vh;
background-color: #000;
overflow: hidden;
}
</style>