- 在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>
45 lines
1.0 KiB
Vue
45 lines
1.0 KiB
Vue
<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>
|