fix(登录): 修复登录流程问题并优化样式

- 在登录前清除本地存储的用户数据
- 允许直接访问登录页面无需重定向
- 调整销售时间线组件的字体大小和间距
This commit is contained in:
2025-08-28 21:37:50 +08:00
parent 21ef158ce4
commit 2f380b1fe5
3 changed files with 32 additions and 23 deletions

View File

@@ -104,6 +104,12 @@ router.beforeEach(async (to, from, next) => {
return return
} }
// 如果访问登录页面,始终允许访问(允许重新登录)
if (to.path === '/login') {
next()
return
}
// 检查是否已登录 // 检查是否已登录
if (!userStore.isLoggedIn || !userStore.userInfo) { if (!userStore.isLoggedIn || !userStore.userInfo) {
next('/login') next('/login')

View File

@@ -395,6 +395,9 @@ const handleLogin = async () => {
loading.value = true loading.value = true
errorMessage.value = '' errorMessage.value = ''
// 清除本地存储的用户数据,确保使用最新的登录信息
userStore.logout()
try { try {
// 调用登录API // 调用登录API
// token检测 // token检测

View File

@@ -850,13 +850,13 @@ $indigo: #4f46e5;
width: 100%; width: 100%;
.stage-title { .stage-title {
font-size: 1.25rem; font-size: 1rem;
font-weight: 500; font-weight: 500;
color: $slate-700; color: $slate-700;
margin: 0 0 0.75rem 0; margin: 0 0 0.75rem 0;
@media (max-width: 768px) { @media (max-width: 768px) {
font-size: 1.125rem; font-size: 0.875rem;
} }
} }
@@ -868,25 +868,25 @@ $indigo: #4f46e5;
margin-bottom: 0.5rem; margin-bottom: 0.5rem;
.stage-count { .stage-count {
font-size: 2rem; font-size: 1.5rem;
font-weight: 700; font-weight: 700;
color: $slate-600; color: $slate-600;
line-height: 1; line-height: 1;
@media (max-width: 768px) { @media (max-width: 768px) {
font-size: 1.75rem; font-size: 1.25rem;
} }
} }
.stage-label { .stage-label {
font-size: 0.875rem; font-size: 0.75rem;
color: $slate-500; color: $slate-500;
font-weight: 500; font-weight: 500;
} }
} }
.stage-percentage { .stage-percentage {
font-size: 0.875rem; font-size: 0.75rem;
color: $slate-400; color: $slate-400;
font-weight: 500; font-weight: 500;
background: $slate-100; background: $slate-100;
@@ -922,8 +922,9 @@ $indigo: #4f46e5;
.items-grid { .items-grid {
display: grid; display: grid;
grid-template-columns: repeat(7, 1fr); grid-template-columns: repeat(7, minmax(0, 250px));
gap: 0.45rem; gap: 0.45rem;
justify-content: center;
@media (max-width: 768px) { @media (max-width: 768px) {
grid-template-columns: repeat(2, 1fr); grid-template-columns: repeat(2, 1fr);
@@ -1079,7 +1080,7 @@ $indigo: #4f46e5;
.item-name { .item-name {
font-weight: 600; font-weight: 600;
font-size: 0.9rem; font-size: 0.875rem;
line-height: 1.3; line-height: 1.3;
color: $slate-800; color: $slate-800;
@@ -1090,11 +1091,11 @@ $indigo: #4f46e5;
max-width: 100%; max-width: 100%;
@media (max-width: 768px) { @media (max-width: 768px) {
font-size: 0.875rem; font-size: 0.75rem;
} }
@media (max-width: 480px) { @media (max-width: 480px) {
font-size: 0.8125rem; font-size: 0.75rem;
} }
} }
} }
@@ -1132,7 +1133,7 @@ $indigo: #4f46e5;
.profession-education { .profession-education {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 0.75rem; gap: 0.2rem;
flex-wrap: wrap; flex-wrap: wrap;
@media (max-width: 480px) { @media (max-width: 480px) {
@@ -1141,16 +1142,16 @@ $indigo: #4f46e5;
.profession, .education { .profession, .education {
font-size: 0.75rem; font-size: 0.75rem;
border-radius: 0.375rem; border-radius: 0.3rem;
font-weight: 500; font-weight: 500;
@media (max-width: 768px) { @media (max-width: 768px) {
font-size: 0.6875rem; font-size: 0.75rem;
padding: 0.1875rem 0.375rem; padding: 0.1875rem 0.375rem;
} }
@media (max-width: 480px) { @media (max-width: 480px) {
font-size: 0.625rem; font-size: 0.75rem;
padding: 0.125rem 0.25rem; padding: 0.125rem 0.25rem;
} }
} }
@@ -1169,19 +1170,18 @@ $indigo: #4f46e5;
background-color: #e8f5e8; background-color: #e8f5e8;
color: #2e7d32; color: #2e7d32;
font-size: 0.75rem; font-size: 0.75rem;
padding: 0.125rem 0.5rem; padding: 0.1rem 0.5rem;
border-radius: 0.375rem; border-radius: 0.3rem;
font-weight: 500; font-weight: 500;
display: inline-block; display: inline-block;
margin-left: 0.5rem;
@media (max-width: 768px) { @media (max-width: 768px) {
font-size: 0.6875rem; font-size: 0.75rem;
padding: 0.1875rem 0.375rem; padding: 0.1875rem 0.375rem;
} }
@media (max-width: 480px) { @media (max-width: 480px) {
font-size: 0.625rem; font-size: 0.75rem;
padding: 0.125rem 0.25rem; padding: 0.125rem 0.25rem;
margin-left: 0.375rem; margin-left: 0.375rem;
} }
@@ -1190,21 +1190,21 @@ $indigo: #4f46e5;
.course-attendance { .course-attendance {
display: inline-block; display: inline-block;
// margin-top: 0.25rem; // margin-top: 0.25rem;
padding: 0.125rem 0.5rem; padding: 0.1rem 0.25rem;
background: linear-gradient(135deg, #e3f2fd, #bbdefb); background: linear-gradient(135deg, #e3f2fd, #bbdefb);
border-radius: 0.375rem; border-radius: 0.3rem;
font-size: 0.75rem; font-size: 0.75rem;
color: #1565c0; color: #1565c0;
font-weight: 500; font-weight: 500;
border: 1px solid #90caf9; border: 1px solid #90caf9;
@media (max-width: 768px) { @media (max-width: 768px) {
font-size: 0.6875rem; font-size: 0.75rem;
padding: 0.1875rem 0.375rem; padding: 0.1875rem 0.375rem;
} }
@media (max-width: 480px) { @media (max-width: 480px) {
font-size: 0.625rem; font-size: 0.75rem;
padding: 0.125rem 0.25rem; padding: 0.125rem 0.25rem;
} }
} }