From 42e2cbb2c158157621945333795e949442e589f9 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Fri, 04 Jul 2025 09:21:18 +0800
Subject: [PATCH] Merge branch 'test' into prod
---
src/permission.js | 12 +++--
src/views/dataCenter/dataCenter.vue | 6 +-
src/page/index/top/top-qna.vue | 43 +++++++++++++--------
src/page/index/top/index.vue | 4 +
src/axios.js | 16 ++++---
5 files changed, 48 insertions(+), 33 deletions(-)
diff --git a/src/axios.js b/src/axios.js
index 979b7c0..d9ad49d 100644
--- a/src/axios.js
+++ b/src/axios.js
@@ -34,7 +34,7 @@
baseUrl
} from '@/config/env';
import crypto from '@/utils/crypto';
-
+const adminUrl = import.meta.env.VITE_APP_DASHBOARD_URL
// 全局未授权错误提示状态,只提示一次
let isErrorShown = false;
@@ -170,9 +170,10 @@
removeToken();
removeRefreshToken();
// 重定向到登录页
- store.dispatch('FedLogOut').then(() => router.push({
- path: '/login'
- }));
+ // store.dispatch('FedLogOut').then(() => router.push({
+ // path: '/login'
+ // }));
+ store.dispatch('FedLogOut').then(() => window.location.replace(`${adminUrl}#/login`));
return Promise.reject(new Error(message));
});
}
@@ -190,9 +191,10 @@
removeToken();
removeRefreshToken();
// 重定向到登录页
- store.dispatch('FedLogOut').then(() => router.push({
- path: '/login'
- }));
+ // store.dispatch('FedLogOut').then(() => router.push({
+ // path: '/login'
+ // }));
+ store.dispatch('FedLogOut').then(() => window.location.replace(`${adminUrl}#/login`));
return Promise.reject(new Error(message));
}
// 如果请求为oauth2错误码则首次报错时提示
diff --git a/src/page/index/top/index.vue b/src/page/index/top/index.vue
index dcdcb8d..9026c9a 100644
--- a/src/page/index/top/index.vue
+++ b/src/page/index/top/index.vue
@@ -102,7 +102,9 @@
type: 'warning',
}).then(() => {
this.$store.dispatch('LogOut').then(() => {
- this.$router.push({ path: '/login' })
+ // this.$router.push({ path: '/login' })
+ const adminUrl = import.meta.env.VITE_APP_DASHBOARD_URL
+ window.location.replace(`${adminUrl}#/login`)
})
})
},
diff --git a/src/page/index/top/top-qna.vue b/src/page/index/top/top-qna.vue
index 9430a53..5c5b028 100644
--- a/src/page/index/top/top-qna.vue
+++ b/src/page/index/top/top-qna.vue
@@ -1,7 +1,10 @@
<template>
<div class="top-qna">
<el-dropdown @command="dropdownClick">
- <img alt="" src="@/assets/images/helpCenter/helpIcon.png" />
+ <!-- <img class="help-icon" alt="" src="@/assets/images/helpCenter/helpIcon.png" /> -->
+ <el-icon class="help-icon" color="#707070" size="17">
+ <QuestionFilled />
+ </el-icon>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item command="guide">入门指南</el-dropdown-item>
@@ -19,7 +22,7 @@
const router = useRouter();
const systemupdateFilePath = ref(null);
const rumenPath = ref(null);
-const fileData = ref([]); // 存储所有文件数据
+const fileData = ref([]);
const loading = ref(false);
const getlistDataAPI = async () => {
loading.value = true;
@@ -27,21 +30,19 @@
const res = await listDataAPI();
if (res.data.code === 200 && res.data.data) {
fileData.value = res.data.data;
-
- // 使用 find 方法查找特定条目
- const systemUpdateItem = res.data.data.find(item => item.id === 4);
- const rumenItem = res.data.data.find(item => item.id === 2);
-
+ const systemUpdateItem = res.data.data.find(item => item.id === 4); //系统更新
+ const rumenItem = res.data.data.find(item => item.id === 2); //入门指南
+
if (systemUpdateItem) {
systemupdateFilePath.value = systemUpdateItem.filePath;
} else {
- console.warn('未找到系统更新条目');
+ console.warn('暂无系统更新');
}
-
+
if (rumenItem) {
rumenPath.value = rumenItem.filePath;
} else {
- console.warn('未找到入门指南条目');
+ console.warn('暂无入门指南');
}
} else {
ElMessage.error('获取帮助数据失败');
@@ -54,23 +55,24 @@
}
};
const dropdownClick = val => {
- // 确保数据已加载
if (loading.value) {
ElMessage.warning('数据正在加载,请稍后');
return;
}
-
+
if (val === 'guide') {
if (!rumenPath.value) {
- ElMessage.warning('入门指南文件未找到');
+ ElMessage.warning('暂无入门指南文件');
return;
}
- window.open(rumenPath.value, '_blank');
+ window.open(rumenPath.value, '_blank');
} else if (val === 'systemupdate') {
- window.open(systemupdateFilePath.value, '_blank');
-
-
+ if (!systemupdateFilePath.value) {
+ ElMessage.warning('暂无系统更新文件');
+ return;
+ }
+ window.open(systemupdateFilePath.value, '_blank');
}
};
@@ -86,5 +88,12 @@
font-size: 18px;
justify-content: center;
cursor: pointer;
+ .help-icon {
+ width: 25px;
+ height: 25px;
+ }
+ .theme-white .el-dropdown {
+ color: none !important;
+ }
}
</style>
diff --git a/src/permission.js b/src/permission.js
index f12dc4e..5272458 100644
--- a/src/permission.js
+++ b/src/permission.js
@@ -18,7 +18,7 @@
NProgress.configure({ showSpinner: false })
const lockPage = '/lock' //锁屏页
const urlParams = getUrlParams(window.location.href)
-
+const adminUrl = import.meta.env.VITE_APP_DASHBOARD_URL
function findRouteByPath (routes, targetPath) {
// 遍历数组中的每个路由对象
for (const route of routes) {
@@ -93,9 +93,10 @@
} else {
const systemToken = store.getters.token || urlParams?.token
if (systemToken === 0) {
- store.dispatch('FedLogOut').then(() => {
- next({ path: '/login' })
- })
+ // store.dispatch('FedLogOut').then(() => {
+ // next({ path: '/login' })
+ // })
+ store.dispatch('FedLogOut').then(() => window.location.replace(`${adminUrl}#/login`));
} else {
const meta = to.meta || {}
const query = to.query || {}
@@ -120,7 +121,8 @@
if (meta.isAuth === false) {
next()
} else {
- next('/login')
+ // next('/login')
+ window.location.replace(`${adminUrl}#/login`)
}
}
})
diff --git a/src/views/dataCenter/dataCenter.vue b/src/views/dataCenter/dataCenter.vue
index 31fa8ad..c12fd85 100644
--- a/src/views/dataCenter/dataCenter.vue
+++ b/src/views/dataCenter/dataCenter.vue
@@ -71,9 +71,9 @@
</el-table-column>
<el-table-column prop="jobTime" label="任务时间" />
<el-table-column property="photoType" label="文件类别">
- <template #default="scope">
+ <template #default="scope">
<span>{{
- photoTypeMap[scope.row.photoType] ? photoTypeMap[scope.row.photoType] : 'tif'
+ photoTypeMap[scope.row.photoType] ? photoTypeMap[scope.row.photoType] : '--'
}}</span>
</template>
</el-table-column>
@@ -188,7 +188,7 @@
文件类型:{{
photoTypeMap[dialogDetailList?.photoType]
? photoTypeMap[dialogDetailList?.photoType]
- : 'tif'
+ : '--'
}}
</div>
<div>
--
Gitblit v1.9.3