Files
iot_web/src/App.vue
NewName 3c0b29333c feat(app): 添加全局加载组件和CAS单点登录功能
- 在App.vue中引入GlobalLoading组件并挂载到全局
- 新增src/components/GlobalLoading/index.vue组件文件
- 在auth.js中添加AccessUserKey常量和相关存储方法
- 在login.js中添加logincas和outlogcas接口函数
- 在main.js中注册GlobalLoading全局组件
- 修改Navbar.vue实现CAS登出逻辑和跳转处理
- 增加sessionStorage和localStorage清理机制

Signed-off-by: NewName <1048783178@qq.com>
2026-03-27 16:25:31 +08:00

45 lines
1.0 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<div id="app" style="background-color:#0e2e87" v-if="$route.meta.bigScreen">
<router-view />
<global-loading ref="globalLoading" />
</div>
<div id="app" v-else>
<router-view :key="language"/>
<theme-picker />
<global-loading ref="globalLoading" />
</div>
</template>
<script>
import ThemePicker from "@/components/ThemePicker";
import GlobalLoading from '@/components/GlobalLoading'
export default {
name: "App",
components: { ThemePicker, GlobalLoading },
metaInfo() {
return {
title: this.$store.state.settings.dynamicTitle && this.$store.state.settings.title,
titleTemplate: title => {
return title ? `${title} - ${process.env.VUE_APP_TITLE}` : process.env.VUE_APP_TITLE
}
}
},
computed:{
language(){
return this.$store.state.settings.language
}
},
mounted() {
// 将loading方法挂载到全局方便在任何组件中调用
this.$root.$loading = this.$refs.globalLoading
}
};
</script>
<style scoped>
#app .theme-picker {
display: none;
}
</style>