From 72bab25f3f8cf29ad7abb44b3c62c04c8afcb3c0 Mon Sep 17 00:00:00 2001 From: DXC Date: Tue, 15 Sep 2026 17:42:47 +0800 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20=E4=BF=AE=E6=AD=A3=20Login.vue?= =?UTF-8?q?=20=E5=AF=BC=E5=85=A5=E5=A4=A7=E5=B0=8F=E5=86=99=EF=BC=8C?= =?UTF-8?q?=E9=81=BF=E5=85=8D=20Linux=20=E6=9E=84=E5=BB=BA=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit router/index.js 里写的是 '../views/Login.vue',但磁盘上的实际文件名是全小写的 login.vue。Windows 文件系统不区分大小写,所以本地 npm run build 一直能过; 一旦在 Linux / Docker / CI 上构建就会直接报 Could not resolve,属于典型的 “本机好使、上线就炸”的定时炸弹。 已用精确字符串比对(而非 fs.exists,后者在 Windows 上大小写不敏感、测不出来) 扫描了 src 下全部 import,确认只有这一处不匹配。 --- zhandianxinxi/光谱数据监控/src/router/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zhandianxinxi/光谱数据监控/src/router/index.js b/zhandianxinxi/光谱数据监控/src/router/index.js index 044addc..f1c8698 100644 --- a/zhandianxinxi/光谱数据监控/src/router/index.js +++ b/zhandianxinxi/光谱数据监控/src/router/index.js @@ -1,8 +1,10 @@ import { createRouter, createWebHistory } from 'vue-router' import { ElMessage } from 'element-plus' -// 1. 引入登录页面(建议新建 views/Login.vue) -import Login from '../views/Login.vue' +// 1. 引入登录页面 +// 注意:实际文件名是全小写的 login.vue。Windows 文件系统不区分大小写,所以本地 +// 构建能过;但在 Linux/Docker/CI 上会直接报 Could not resolve,必须严格匹配。 +import Login from '../views/login.vue' // 2. 首页组件 import Dashboard from '../views/Dashboard.vue'