Files
cdTestPlant3/cdTMP/src/App.vue
2024-08-12 19:34:21 +08:00

24 lines
606 B
Vue

<template>
<a-config-provider>
<router-view />
</a-config-provider>
</template>
<script setup lang="ts">
import { onUnmounted } from "vue"
import { Modal } from "@arco-design/web-vue"
const storageEvent = function (e: StorageEvent) {
if (e.key === "token") {
Modal.warning({
title: "警告消息",
content: "登录用户在其他窗口发生改变,正在刷新浏览器"
})
}
}
window.addEventListener("storage", storageEvent)
onUnmounted(() => {
window.removeEventListener("storage", storageEvent)
})
</script>
<style scoped></style>