From afb041ea9ffc183b607372881aa058843fb899ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=88=E5=85=86=E5=A2=9E?= <你的邮箱@example.com> Date: Tue, 5 May 2026 22:38:24 +0800 Subject: [PATCH] =?UTF-8?q?bug=20=E4=BF=AE=E6=94=B9=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/BasicTable/index.vue | 9 +++++++- frontend/src/layout/components/Navbar.vue | 5 +---- frontend/src/permission.ts | 4 ++-- frontend/src/router/index.ts | 4 ++-- frontend/src/styles/ant-design-vue.scss | 16 ++------------ frontend/src/utils/auth.ts | 9 -------- frontend/src/views/login-sjtb/index.vue | 4 +--- frontend/src/views/login/index.vue | 2 -- frontend/src/views/register/index.vue | 4 ++-- .../guoYuSheShiShuJuTianBaoForm.vue | 7 ++++--- .../guoYuSheShiShuJuTianBaoTable.vue | 5 +++-- .../guoYuSheShiShuJuTianBao/index.vue | 21 ++++++++++--------- 12 files changed, 36 insertions(+), 54 deletions(-) diff --git a/frontend/src/components/BasicTable/index.vue b/frontend/src/components/BasicTable/index.vue index 983aec4..0ec8d85 100644 --- a/frontend/src/components/BasicTable/index.vue +++ b/frontend/src/components/BasicTable/index.vue @@ -63,6 +63,9 @@ const page = ref(1); const size = ref(props.defaultPageSize); const selectedRowKeys = ref([]); const selectedRows = ref([]); +//保存最后一次使用的 filter +const lastFilter = ref | undefined>(undefined); + // 计算表格滚动高度 const scrollConfig = computed(() => ({ @@ -100,13 +103,17 @@ const paginationConfig = computed(() => ({ */ const getList = async (filter?: Record) => { loading.value = true; + // 如果传入了新 filter,则更新;否则保留旧的 + if (filter !== undefined) { + lastFilter.value = filter; + } try { // 合并基础分页参数、外部搜索参数和临时参数 const params = { ...props.searchParams, skip: page.value, take: size.value, - filter: filter, + filter: lastFilter.value, // 如果后端需要 skip/take 格式,可以在此转换 // skip: (page.value - 1) * size.value, diff --git a/frontend/src/layout/components/Navbar.vue b/frontend/src/layout/components/Navbar.vue index 1605ec6..86be462 100644 --- a/frontend/src/layout/components/Navbar.vue +++ b/frontend/src/layout/components/Navbar.vue @@ -11,7 +11,6 @@ import Sidebar from "./Sidebar/index.vue"; import { useTagsViewStore } from "@/store/modules/tagsView"; import { useUserStore } from "@/store/modules/user"; -import {getPath,removePath } from '@/utils/auth'; // const url = import.meta.env.VITE_APP_BASE_API; @@ -32,9 +31,7 @@ function logout() { tagsViewStore.delAllViews(); }) .then(() => { - // router.push(`/login?redirect=${route.fullPath}`); - router.push(`${getPath()}?redirect=${route.fullPath}`); - removePath() + router.push(`/login`); }); }); } diff --git a/frontend/src/permission.ts b/frontend/src/permission.ts index f18e04e..b0bd66a 100644 --- a/frontend/src/permission.ts +++ b/frontend/src/permission.ts @@ -80,7 +80,7 @@ router.beforeEach(async (to, from, next) => { } catch (error) { console.log(error); await userStore.resetToken(); - next(`/login?redirect=${to.path}`); + next(`/login`); NProgress.done(); } } @@ -91,7 +91,7 @@ router.beforeEach(async (to, from, next) => { if (whiteList.indexOf(to.path) !== -1) { next(); } else { - next(`/login?redirect=${to.path}`); + next(`/login`); NProgress.done(); } } diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index b07315d..c1ac5dd 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -1,4 +1,4 @@ -import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'; +import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'; import { usePermissionStoreHook } from '@/store/modules/permission'; export const Layout = () => import('@/layout/index.vue'); @@ -45,7 +45,7 @@ export const constantRoutes: RouteRecordRaw[] = [ // 创建路由 const router = createRouter({ - history: createWebHashHistory(), + history: createWebHistory(), routes: constantRoutes as RouteRecordRaw[], // 刷新时,滚动条位置还原 scrollBehavior: () => ({ left: 0, top: 0 }) diff --git a/frontend/src/styles/ant-design-vue.scss b/frontend/src/styles/ant-design-vue.scss index 36e0520..4ce5f83 100644 --- a/frontend/src/styles/ant-design-vue.scss +++ b/frontend/src/styles/ant-design-vue.scss @@ -1,16 +1,4 @@ -.ant-model { - .ant-modal-content { - border-radius: 2px; - } - .ant-modal-header { - padding: 16px 24px; - color: rgba(0, 0, 0, 0.85); - border-bottom: 1px solid #f0f0f0; - border-radius: 2px 2px 0 0; - background-color: #005293; - } -} -:where(.css-dev-only-do-not-override-ekaqbe).ant-modal { +.ant-modal { .ant-modal-content { border-radius: 2px; padding: 0 !important; @@ -37,7 +25,7 @@ } } } -:where(.css-dev-only-do-not-override-ekaqbe).ant-btn > span { +.ant-btn > span { display: inline-flex; } .ant-image-preview-root { diff --git a/frontend/src/utils/auth.ts b/frontend/src/utils/auth.ts index fb101b1..2976699 100644 --- a/frontend/src/utils/auth.ts +++ b/frontend/src/utils/auth.ts @@ -12,13 +12,4 @@ export function setToken(token: any) { export function removeToken() { return Cookies.remove(TokenKey); -} -export function setPath(path:any) { - Cookies.set(PathKey,path); -} -export function getPath() { - return Cookies.get(PathKey); -} -export function removePath() { - return Cookies.remove(PathKey); } \ No newline at end of file diff --git a/frontend/src/views/login-sjtb/index.vue b/frontend/src/views/login-sjtb/index.vue index fb41c60..ae94e2f 100644 --- a/frontend/src/views/login-sjtb/index.vue +++ b/frontend/src/views/login-sjtb/index.vue @@ -187,7 +187,7 @@ import loginImg from "@/assets/images/logo.png"; import { UserOutlined, LockOutlined, MobileOutlined } from "@ant-design/icons-vue"; import { getCaptcha, sendSmsCode, smsLoginApi, resetPassword } from "@/api/auth"; import { message } from "ant-design-vue"; -import { setPath, setToken } from "@/utils/auth"; +import { setToken } from "@/utils/auth"; // 组件依赖 import router from "@/router"; @@ -371,7 +371,6 @@ function onFinish() { userStore .login(user) .then(() => { - setPath("/login-sjtb"); router.push({ path: "/" }); state.loading = false; message.success("登录成功"); @@ -457,7 +456,6 @@ const onSmsLogin = async () => { }); // ========== 第九部分:设置路径并跳转 ========== - setPath("/login-sjtb"); router.push({ path: accessRoutes[0].children[0].opturl }); message.success("登录成功"); diff --git a/frontend/src/views/login/index.vue b/frontend/src/views/login/index.vue index a74742b..731cc81 100644 --- a/frontend/src/views/login/index.vue +++ b/frontend/src/views/login/index.vue @@ -240,7 +240,6 @@