diff --git a/frontend/index.html b/frontend/index.html
index d564dd2..e8da7b9 100644
--- a/frontend/index.html
+++ b/frontend/index.html
@@ -7,7 +7,7 @@
-
OMS 管理系统
+ 天豹云OMS订单管理系统
diff --git a/frontend/src/layouts/BasicLayout.vue b/frontend/src/layouts/BasicLayout.vue
index 75fa58f..2ec967a 100644
--- a/frontend/src/layouts/BasicLayout.vue
+++ b/frontend/src/layouts/BasicLayout.vue
@@ -142,7 +142,7 @@ function logout() {
}
function goLogin() {
- router.push('/login')
+ router.push('/')
}
// 进入导出任务页(全局任务池:提交后后台异步处理,完成后自动下载)
@@ -167,7 +167,7 @@ function onPrincipalChange(id: number) {
- OMS 管理系统
+ 天豹云OMS订单管理系统
@@ -281,10 +281,12 @@ function onPrincipalChange(id: number) {
display: flex;
align-items: center;
justify-content: center;
- font-size: 18px;
+ font-size: 15px;
font-weight: 600;
+ letter-spacing: 0.5px;
color: var(--el-color-primary);
border-bottom: 1px solid var(--el-border-color);
+ white-space: nowrap;
}
.app-menu {
diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts
index 40f3019..252f2c9 100644
--- a/frontend/src/router/index.ts
+++ b/frontend/src/router/index.ts
@@ -5,18 +5,22 @@ const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
{
- path: '/login',
+ // 登录页即首页:根路径直接渲染登录页,登录成功后进仪表盘
+ path: '/',
name: 'login',
component: () => import('@/views/Login.vue'),
meta: { public: true },
},
+ // 兼容旧地址 / 旧书签:/login 统一回到首页(登录页)
+ { path: '/login', redirect: { path: '/' } },
{
+ // 后台布局容器:只用于承载带侧边栏的子路由(/dashboard、/order 等由菜单动态注册)。
+ // 与登录页同 path 不影响匹配:根路径 '/' 先命中上面的登录页,子路由按各自全路径命中这里。
path: '/',
component: () => import('@/layouts/BasicLayout.vue'),
name: 'layout',
redirect: { path: '/dashboard' },
children: [
- { path: '', name: 'home', component: () => import('@/views/Home.vue'), meta: { title: '首页' } },
{ path: 'about', name: 'about', component: () => import('@/views/About.vue'), meta: { title: '关于' } },
{
path: 'export-tasks',
@@ -42,7 +46,8 @@ const router = createRouter({
router.beforeEach(async (to) => {
const token = getToken()
if (!to.meta.public && !token) {
- return { name: 'login', query: { redirect: to.fullPath } }
+ // 首页(/)本身就是登录页,无需再带 redirect 参数
+ return to.fullPath === '/' ? { name: 'login' } : { name: 'login', query: { redirect: to.fullPath } }
}
if (to.name === 'login' && token) {
return { path: '/dashboard' }
@@ -64,7 +69,7 @@ router.beforeEach(async (to) => {
}
// 动态路由是运行期注册的,深链接刷新时早于匹配阶段:
// 当前 to 尚未匹配到任何路由 → 用新的路由表重新解析当前目标;
- // 重新解析后仍无匹配(地址不存在或当前权限不可见)则回首页,避免反复重定向
+ // 重新解析后仍无匹配(地址不存在或当前权限不可见)则回仪表盘,避免反复重定向
if (to.matched.length === 0) {
if (to.redirectedFrom && to.redirectedFrom.matched.length === 0) {
return { path: '/dashboard' }
diff --git a/frontend/src/store/auth.ts b/frontend/src/store/auth.ts
index fbe66c4..c1e1805 100644
--- a/frontend/src/store/auth.ts
+++ b/frontend/src/store/auth.ts
@@ -97,7 +97,7 @@ export const useAuthStore = defineStore('auth', () => {
token.value = ''
user.value = null
ElMessage.success('已退出登录')
- router.replace('/login')
+ router.replace('/')
}
function applyToken(value: string) {
diff --git a/frontend/src/utils/request.ts b/frontend/src/utils/request.ts
index 9764d8a..52f10d5 100644
--- a/frontend/src/utils/request.ts
+++ b/frontend/src/utils/request.ts
@@ -96,8 +96,8 @@ service.interceptors.response.use(
// 登录页内(正在登录):直接提示后端返回的具体错误,如「账号或密码错误」
ElMessage.error(message || '登录失败,请检查账号或密码')
} else {
- // 登录失效:清空本地登录态(token 与所选主体)并返回首页
- // (未登录会被路由守卫转到登录页,登录成功后再回到首页)
+ // 登录失效:清空本地登录态(token 与所选主体)并返回首页(登录页)
+ // (首页即登录页,登录成功后直接进仪表盘)
clearToken()
usePrincipalStore().setCurrentId(null)
if (!redirectingToHome) {
diff --git a/frontend/src/views/Login.vue b/frontend/src/views/Login.vue
index 16d90cc..e3d5f85 100644
--- a/frontend/src/views/Login.vue
+++ b/frontend/src/views/Login.vue
@@ -39,10 +39,16 @@ function startCountdown(counter: { value: number }, timerRef: { value?: ReturnTy
}, 1000)
}
+/** 登录成功后的落地页:仪表盘(首页 / 已是登录页,不再回到根路径) */
function goAfterLogin() {
- router.replace((route.query.redirect as string) || '/')
+ const redirect = (route.query.redirect as string) || ''
+ const target = redirect && redirect !== '/' && !redirect.startsWith('/login') ? redirect : '/dashboard'
+ router.replace(target)
}
+/** 页脚版权年份 */
+const year = new Date().getFullYear()
+
/* -------------------- 账号登录 -------------------- */
const loginFormRef = ref()
const loginForm = reactive({
@@ -431,7 +437,7 @@ onUnmounted(() => {
-
天豹 OMS 管理系统
+
天豹云OMS订单管理系统
仓储与订单协同平台
@@ -520,6 +526,15 @@ onUnmounted(() => {
+
+
+
{
position: relative;
width: 100%;
height: 100%;
- padding: 24px 40px;
+ padding: 24px 40px 64px;
overflow: hidden;
display: flex;
+ flex-direction: column;
align-items: center;
justify-content: center;
background-color: #071224;
@@ -686,6 +702,40 @@ onUnmounted(() => {
gap: 48px;
}
+/* 页脚:固定在页面底部居中,不参与左右分栏布局 */
+.login-footer {
+ position: absolute;
+ left: 0;
+ right: 0;
+ bottom: 18px;
+ z-index: 1;
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ justify-content: center;
+ gap: 6px;
+ padding: 0 16px;
+ font-size: 13px;
+ line-height: 1.6;
+ color: rgba(203, 220, 246, 0.6);
+ text-align: center;
+}
+
+.login-footer__link {
+ color: inherit;
+ text-decoration: none;
+ transition: color 0.2s;
+}
+
+.login-footer__link:hover {
+ color: #e8f1ff;
+ text-decoration: underline;
+}
+
+.login-footer__sep {
+ opacity: 0.6;
+}
+
/* 左侧插画(inline SVG,按宽度等比缩放,不会把页面撑高) */
.login-visual {
flex: 1 1 auto;
@@ -885,13 +935,20 @@ onUnmounted(() => {
/* 极矮窗口(如被压缩的预览窗):交给页面整体滚动,避免卡片内部再滚动导致点不到按钮 */
@media (max-height: 560px) {
.login-page {
- align-items: flex-start;
+ align-items: center;
+ justify-content: flex-start;
height: auto;
min-height: 100%;
overflow-y: auto;
padding: 16px 24px;
}
+ /* 会出现滚动时页脚改为常规流,避免压在登录卡片上 */
+ .login-footer {
+ position: static;
+ margin-top: 18px;
+ }
+
.login-shell {
max-height: none;
}
@@ -904,11 +961,18 @@ onUnmounted(() => {
/* 窄屏 / 移动端:上下布局,插画在上、表单卡片在下;此时允许页面纵向滚动 */
@media (max-width: 960px) {
.login-page {
- align-items: flex-start;
+ align-items: center;
+ justify-content: flex-start;
height: auto;
min-height: 100%;
overflow: visible;
- padding: 24px 18px 32px;
+ padding: 24px 18px 20px;
+ }
+
+ /* 窄屏内容会超出一屏,页脚跟着内容往下排,不叠在卡片上 */
+ .login-footer {
+ position: static;
+ margin-top: 18px;
}
.login-shell {