|
|
@@ -1,5 +1,11 @@
|
|
|
<template>
|
|
|
<div class="portal-home min-h-screen">
|
|
|
+ <div v-if="showDingTalkLoginMask" class="portal-login-mask">
|
|
|
+ <div class="portal-login-mask__content">
|
|
|
+ <div class="portal-login-mask__spinner"></div>
|
|
|
+ <p class="portal-login-mask__text">正在登录,请稍候...</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<Header />
|
|
|
|
|
|
<main class="px-5 md:px-20 pb-8 pt-20">
|
|
|
@@ -660,6 +666,15 @@ const router = useRouter();
|
|
|
const userStore = useUserStore();
|
|
|
const themeStore = useThemeStore();
|
|
|
|
|
|
+const isDingTalkClient = () => {
|
|
|
+ const ua = window.navigator.userAgent.toLowerCase();
|
|
|
+ return ua.includes("dingtalk") || ua.includes("dingtalkwork");
|
|
|
+};
|
|
|
+
|
|
|
+const showDingTalkLoginMask = ref(
|
|
|
+ isDingTalkClient() && !userStore.getUser.username && !getAccessToken(),
|
|
|
+);
|
|
|
+
|
|
|
const todoPanelTitle = "待办中心";
|
|
|
const newsPanelTitle = "新闻中心";
|
|
|
const noticeTabs = [
|
|
|
@@ -1394,10 +1409,17 @@ const getTagName = (tag: string) => {
|
|
|
|
|
|
let oaTasks = ref([]);
|
|
|
|
|
|
-dingTalkAutoLogin();
|
|
|
onMounted(async () => {
|
|
|
slideTimer = setInterval(nextSlide, 5000);
|
|
|
|
|
|
+ if (showDingTalkLoginMask.value) {
|
|
|
+ try {
|
|
|
+ await dingTalkAutoLogin();
|
|
|
+ } finally {
|
|
|
+ showDingTalkLoginMask.value = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
await loadHomeData();
|
|
|
});
|
|
|
|
|
|
@@ -1608,6 +1630,52 @@ onUnmounted(() => {
|
|
|
background-attachment: fixed, fixed;
|
|
|
}
|
|
|
|
|
|
+.portal-login-mask {
|
|
|
+ position: fixed;
|
|
|
+ inset: 0;
|
|
|
+ z-index: 9999;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ background: rgba(9, 16, 32, 0.52);
|
|
|
+ backdrop-filter: blur(6px);
|
|
|
+ -webkit-backdrop-filter: blur(6px);
|
|
|
+}
|
|
|
+
|
|
|
+.portal-login-mask__content {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ gap: 16px;
|
|
|
+ padding: 28px 36px;
|
|
|
+ border: 1px solid rgba(255, 255, 255, 0.12);
|
|
|
+ border-radius: 18px;
|
|
|
+ background: rgba(10, 20, 40, 0.86);
|
|
|
+ box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
|
|
|
+}
|
|
|
+
|
|
|
+.portal-login-mask__spinner {
|
|
|
+ width: 34px;
|
|
|
+ height: 34px;
|
|
|
+ border: 3px solid rgba(255, 255, 255, 0.2);
|
|
|
+ border-top-color: #ffffff;
|
|
|
+ border-radius: 999px;
|
|
|
+ animation: portal-login-spin 0.9s linear infinite;
|
|
|
+}
|
|
|
+
|
|
|
+.portal-login-mask__text {
|
|
|
+ margin: 0;
|
|
|
+ color: #ffffff;
|
|
|
+ font-size: 14px;
|
|
|
+ letter-spacing: 0.04em;
|
|
|
+}
|
|
|
+
|
|
|
+@keyframes portal-login-spin {
|
|
|
+ to {
|
|
|
+ transform: rotate(360deg);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
:global([data-theme="dark"] .portal-home) {
|
|
|
--portal-text: #eaf1ff;
|
|
|
--portal-text-muted: rgba(234, 241, 255, 0.95);
|