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>
This commit is contained in:
NewName
2026-03-27 16:25:31 +08:00
parent 7c1f4911d2
commit 3c0b29333c
7 changed files with 1404 additions and 1145 deletions

View File

@@ -1,19 +1,22 @@
<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 },
components: { ThemePicker, GlobalLoading },
metaInfo() {
return {
title: this.$store.state.settings.dynamicTitle && this.$store.state.settings.title,
@@ -26,9 +29,14 @@ export default {
language(){
return this.$store.state.settings.language
}
},
mounted() {
// 将loading方法挂载到全局方便在任何组件中调用
this.$root.$loading = this.$refs.globalLoading
}
};
</script>
<style scoped>
#app .theme-picker {
display: none;