From 8f30b943a71beefad42c0cf8ac6f462b406dc9ab Mon Sep 17 00:00:00 2001 From: Kunagisa <1549184870@qq.com> Date: Wed, 25 Jun 2025 21:45:13 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=9C=B0=E5=BD=A2=E5=9B=BE=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 5 + src/views/index.vue | 1 + src/views/index/TerrainList.vue | 378 ++++++++++++++++++++++++++++++++ 3 files changed, 384 insertions(+) create mode 100644 src/views/index/TerrainList.vue diff --git a/src/router/index.js b/src/router/index.js index 83439c8..0bdfab4 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -76,6 +76,11 @@ const routes = [ path: 'editors-maps', name: 'EditorsMaps', component: () => import('@/views/index/EditorsMaps.vue') + }, + { + path:'terrain', + name: 'Terrain', + component: () => import('@/views/index/TerrainList.vue') } ] }, diff --git a/src/views/index.vue b/src/views/index.vue index 4da7d35..b8db920 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -82,6 +82,7 @@ onUnmounted(() => { 最近上传地图 热门下载地图 活跃作者推荐 + 地形图列表 Weapon 匹配 赛程信息 办事大厅 diff --git a/src/views/index/TerrainList.vue b/src/views/index/TerrainList.vue new file mode 100644 index 0000000..c01a0b9 --- /dev/null +++ b/src/views/index/TerrainList.vue @@ -0,0 +1,378 @@ + + + + + + \ No newline at end of file -- 2.47.2 From 7676649f06d5147fb0ac4a9305372fa3fa6d0ea6 Mon Sep 17 00:00:00 2001 From: Kunagisa <1549184870@qq.com> Date: Thu, 26 Jun 2025 18:03:57 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E6=9D=83=E9=99=90=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/backend/CodeGenerator.vue | 926 --------------------- src/components/backend/PlayerList.vue | 328 -------- src/components/backend/ServiceHallView.vue | 530 ------------ src/components/backend/TournamentForm.vue | 210 ----- src/components/backend/TournamentList.vue | 294 ------- src/views/backend/Dashboard.vue | 98 ++- src/views/index.vue | 25 +- 7 files changed, 75 insertions(+), 2336 deletions(-) delete mode 100644 src/components/backend/CodeGenerator.vue delete mode 100644 src/components/backend/PlayerList.vue delete mode 100644 src/components/backend/ServiceHallView.vue delete mode 100644 src/components/backend/TournamentForm.vue delete mode 100644 src/components/backend/TournamentList.vue diff --git a/src/components/backend/CodeGenerator.vue b/src/components/backend/CodeGenerator.vue deleted file mode 100644 index 022c92c..0000000 --- a/src/components/backend/CodeGenerator.vue +++ /dev/null @@ -1,926 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/components/backend/PlayerList.vue b/src/components/backend/PlayerList.vue deleted file mode 100644 index 1cd6562..0000000 --- a/src/components/backend/PlayerList.vue +++ /dev/null @@ -1,328 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/components/backend/ServiceHallView.vue b/src/components/backend/ServiceHallView.vue deleted file mode 100644 index d0b6b02..0000000 --- a/src/components/backend/ServiceHallView.vue +++ /dev/null @@ -1,530 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/components/backend/TournamentForm.vue b/src/components/backend/TournamentForm.vue deleted file mode 100644 index c261760..0000000 --- a/src/components/backend/TournamentForm.vue +++ /dev/null @@ -1,210 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/components/backend/TournamentList.vue b/src/components/backend/TournamentList.vue deleted file mode 100644 index a541c56..0000000 --- a/src/components/backend/TournamentList.vue +++ /dev/null @@ -1,294 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/views/backend/Dashboard.vue b/src/views/backend/Dashboard.vue index c007836..0e87e64 100644 --- a/src/views/backend/Dashboard.vue +++ b/src/views/backend/Dashboard.vue @@ -5,16 +5,52 @@ - 后台管理 + 管理后台
-
- -
-
- -
-
- -
-
- -
+
@@ -49,22 +74,23 @@ - - \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index 0bdfab4..0742236 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -81,7 +81,12 @@ const routes = [ path:'terrain', name: 'Terrain', component: () => import('@/views/index/TerrainList.vue') - } + }, + { + path: 'PIC2TGA', + name: 'PIC2TGA', + component: () => import('@/views/index/PIC2TGA.vue') + }, ] }, { diff --git a/src/views/backend/Dashboard.vue b/src/views/backend/Dashboard.vue index 0e87e64..8ac1245 100644 --- a/src/views/backend/Dashboard.vue +++ b/src/views/backend/Dashboard.vue @@ -12,7 +12,7 @@

管理后台

-
  • +
  • 赛事管理 @@ -40,7 +40,7 @@
  • -
  • +
  • 办事大厅 @@ -53,9 +53,9 @@
  • - +
    @@ -75,6 +78,7 @@ import { ref, onMounted, computed, onUnmounted } from 'vue' import { useRouter } from 'vue-router' import { getUserInfo } from '@/utils/jwt' +import AdminEditUserPrivilege from '@/components/backend/AdminEditUserPrivilege.vue' const router = useRouter() const hasToken = ref(false) @@ -91,10 +95,12 @@ const isAdmin = computed(() => { }) async function checkPrivilege() { + console.log('正在验证权限'); const token = localStorage.getItem('access_token') hasToken.value = !!token if (!token) { router.push('/') + console.log('验证结束'); return; } try { @@ -105,6 +111,7 @@ async function checkPrivilege() { localStorage.removeItem('access_token') currentUserData.value = null router.push('/') + console.log('验证结束'); return; } } catch (e) { @@ -112,12 +119,14 @@ async function checkPrivilege() { localStorage.removeItem('access_token') currentUserData.value = null router.push('/') + console.log('验证结束'); } + console.log('验证结束'); } onMounted(() => { checkPrivilege(); - privilegeCheckTimer = setInterval(checkPrivilege, 2 * 60 * 1000); + privilegeCheckTimer = setInterval(checkPrivilege, 60 * 1000); }) onUnmounted(() => { diff --git a/src/views/index.vue b/src/views/index.vue index fbcf6c6..0bee3d1 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -117,6 +117,19 @@ onUnmounted(() => { // 移除事件监听器 document.removeEventListener('click', handleClickOutside) }) + +// 判断每个一级菜单是否有可见项 +const showTerrainList = true // 地形图列表始终可见 +const showTerrainGenerate = computed(() => isLoggedIn.value && currentUserData.value) +const showWeaponMatch = computed(() => isLoggedIn.value && currentUserData.value && hasPrivilege(currentUserData.value.privilege, ['lv-admin', 'lv-mod'])) +const showPic2Tga = computed(() => isLoggedIn.value && currentUserData.value) +const showDemands = computed(() => isLoggedIn.value && currentUserData.value) +const showCompetition = computed(() => isLoggedIn.value && currentUserData.value && hasPrivilege(currentUserData.value.privilege, ['lv-admin', 'lv-competitor'])) + +const showTerrainMenu = computed(() => showTerrainList || showTerrainGenerate.value) +const showOnlineToolsMenu = computed(() => showWeaponMatch.value || showPic2Tga.value) +const showPublicMenu = computed(() => showDemands.value) +const showCompetitionMenu = computed(() => showCompetition.value)