From 99c78954a324bbe94ce185a8290f1458f222a6ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BF=94?= Date: Wed, 8 Apr 2026 15:42:09 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=94=A8=E6=88=B7=E6=90=9C=E7=B4=A2=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E5=90=8D=E7=A7=B0=E4=B8=8D=E4=B8=80=E8=87=B4=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将前端搜索参数从 username 改为 keyword,与后端 API 保持一致 - 更新 UserPageRequest 接口,添加 keyword 字段 问题原因: - 前端传递 username 参数,但后端期望 keyword 参数 - 导致后端无法正确处理搜索请求,搜索关键字为 null 影响范围: - 用户管理页面的搜索功能 - E2E 测试中的用户搜索步骤 --- novalon-manage-web/e2e/customReporter.ts | 10 +++++++--- novalon-manage-web/playwright/.auth/user.json | 2 +- novalon-manage-web/src/api/user.api.ts | 1 + novalon-manage-web/src/views/system/UserManagement.vue | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/novalon-manage-web/e2e/customReporter.ts b/novalon-manage-web/e2e/customReporter.ts index c57a971..f47b2c9 100644 --- a/novalon-manage-web/e2e/customReporter.ts +++ b/novalon-manage-web/e2e/customReporter.ts @@ -113,9 +113,13 @@ class CustomReporter implements Reporter { if (stats.failedTests.length > 0) { console.log('❌ 失败的测试:'); stats.failedTests.forEach((test, index) => { - console.log(` ${index + 1}. ${test.title}`); - console.log(` 位置: ${test.location.file}:${test.location.line}`); - console.log(` 错误: ${test.error?.message}`); + console.log(` ${index + 1}. ${test.title || '未命名测试'}`); + if (test.location?.file) { + console.log(` 位置: ${test.location.file}:${test.location.line || 0}`); + } + if (test.error?.message) { + console.log(` 错误: ${test.error.message}`); + } }); console.log(''); } diff --git a/novalon-manage-web/playwright/.auth/user.json b/novalon-manage-web/playwright/.auth/user.json index cd39133..b72a03c 100644 --- a/novalon-manage-web/playwright/.auth/user.json +++ b/novalon-manage-web/playwright/.auth/user.json @@ -6,7 +6,7 @@ "localStorage": [ { "name": "token", - "value": "eyJhbGciOiJIUzM4NCJ9.eyJyb2xlcyI6WyJhZG1pbiJdLCJ1c2VySWQiOjEsInVzZXJuYW1lIjoiYWRtaW4iLCJzdWIiOiJhZG1pbiIsImlhdCI6MTc3NTYzMjQ5OCwiZXhwIjoxNzc1NzE4ODk4fQ.pBjBrFhB-aLbneWoasbZn-K-JUAAZQHEzXsRXyQ_042q24gWkbznWm9MVm9tPtDS" + "value": "eyJhbGciOiJIUzM4NCJ9.eyJyb2xlcyI6WyJhZG1pbiJdLCJ1c2VySWQiOjEsInVzZXJuYW1lIjoiYWRtaW4iLCJzdWIiOiJhZG1pbiIsImlhdCI6MTc3NTYzMzUxMiwiZXhwIjoxNzc1NzE5OTEyfQ.z8GEm_YKF0jGh_KWAk9NVW41TL9JDY5RcgQaLEpktrk2JRDWs9gfuLV0fQSs3EJ5" }, { "name": "permission", diff --git a/novalon-manage-web/src/api/user.api.ts b/novalon-manage-web/src/api/user.api.ts index 40dce19..c06e4de 100644 --- a/novalon-manage-web/src/api/user.api.ts +++ b/novalon-manage-web/src/api/user.api.ts @@ -35,6 +35,7 @@ export interface UpdateUserRequest { export interface UserPageRequest { page: number size: number + keyword?: string username?: string nickname?: string status?: string diff --git a/novalon-manage-web/src/views/system/UserManagement.vue b/novalon-manage-web/src/views/system/UserManagement.vue index 45b5a2b..5d22391 100644 --- a/novalon-manage-web/src/views/system/UserManagement.vue +++ b/novalon-manage-web/src/views/system/UserManagement.vue @@ -291,7 +291,7 @@ const fetchData = async () => { size: pagination.pageSize, sortBy: sortInfo.sortBy, sortOrder: sortInfo.sortOrder, - username: searchKeyword.value || undefined + keyword: searchKeyword.value || undefined }) dataSource.value = res.content pagination.total = res.totalElements