From ecf8d39f034247642f92e22b66a3703b6300bab1 Mon Sep 17 00:00:00 2001 From: qubiaobiao <3294694717@qq.com> Date: Tue, 29 Sep 2026 12:17:48 +0800 Subject: [PATCH] =?UTF-8?q?chore(frontend):=20=E7=A7=BB=E9=99=A4=E5=AD=A4?= =?UTF-8?q?=E5=84=BF=E8=B7=AF=E7=94=B1=20/upload=20=E4=B8=8E=20Upload.vue?= =?UTF-8?q?=EF=BC=88BACKLOG=20B2=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 定性:/upload 是全仓零 UI 入口的孤儿路由。 - Dashboard.enterContest() 对所有组别统一 router.push('/competition'); 全仓 push('/upload') / replace('/upload') / to="/upload" / name:'Upload' 0 命中, Upload.vue 只被 router 一处 import。 - 本科/教师的答案文件上传链路早已由 Competition.vue 的 exam-upload-mode 完整承担 (zip 独占 / pdf-docx 互斥 / 组合校验 / 覆盖式重传 / 删除)。 - 该页对中职/高职会调用后端不支持的分组接口 (GET /api/upload/{zhongzhi,gaozhi}/status|submissions → 「无效的组别,仅支持 benke/jiaoshi」), 因守卫只弹 warning 且注释明写"不强制跳转",随后仍无条件发请求 ⇒ 3 条 console 报错。 处置(三方案中的 ①;②接线会使 Competition.vue 上传模式被孤立,属功能倒退;③被①涵盖): - src/router/index.js: 删 import Upload 与 /upload 路由块(-9 行) - src/views/Upload.vue: git rm(-735 行) - 保留 src/api/upload.js:stores/exam.js 与 Competition.vue 仍在用 getUploadStatus / uploadWork / deleteWork / getSubmissions 验证: - 前置:全项目(docs/deploy/nginx/bat/ps1/后端)零外部引用;Upload.vue 无具名导出 - vite build exit 0;dist 异步分片列表已无 Upload-*.js(残留 upload-*.js 是 MD5 库分片,0 页面文案) - TDZ 扫描 37 文件 PASS(原 38,正好少一) - 真浏览器:/login 9/9 · /upload 现落 404 页且 0 pageerror / 0 console error (修复前:渲染旧上传页 + 3 条 console 报错) --- src/router/index.js | 9 - src/views/Upload.vue | 735 ------------------------------------------- 2 files changed, 744 deletions(-) delete mode 100644 src/views/Upload.vue diff --git a/src/router/index.js b/src/router/index.js index 07334f7..642c461 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -16,7 +16,6 @@ const Competition = () => import('@/views/Competition.vue') const MockExam = () => import('@/views/MockExam.vue') const NmeaParser = () => import('@/views/NmeaParser.vue') const AtSimulator = () => import('@/views/AtSimulator.vue') -const Upload = () => import('@/views/Upload.vue') const Materials = () => import('@/views/Materials.vue') const Score = () => import('@/views/Score.vue') @@ -106,14 +105,6 @@ const routes = [ meta: { requiresAuth: true }, }, - // 作品上传页 - { - path: '/upload', - name: 'Upload', - component: Upload, - meta: { requiresAuth: true }, - }, - // 资料下载页 { path: '/materials', diff --git a/src/views/Upload.vue b/src/views/Upload.vue deleted file mode 100644 index 5659b01..0000000 --- a/src/views/Upload.vue +++ /dev/null @@ -1,735 +0,0 @@ - - - - - - - - - \ No newline at end of file