Skip to content

Commit 110cc57

Browse files
committed
修复Id匹配问题
1 parent 3dc5889 commit 110cc57

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

mock/menu.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ function showMenu(req: Request, res: Response, u: string) {
145145
let dataSource = [...tableListDataSource];
146146

147147
if (params.id) {
148-
dataSource = dataSource.filter((data) => data.id.includes(params.id || ''));
148+
dataSource = dataSource.filter((data) => data.id === params.id);
149149
}
150150
if (dataSource.length === 0) {
151151
return res.status(404).json({

mock/permission.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ function showPermission(req: Request, res: Response, u: string) {
9696
let dataSource = [...tableListDataSource];
9797

9898
if (params.id) {
99-
dataSource = dataSource.filter((data) => data.id.includes(params.id || ''));
99+
dataSource = dataSource.filter((data) => data.id === params.id);
100100
}
101101
if (dataSource.length === 0) {
102102
return res.status(404).json({

mock/role.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function showRole(req: Request, res: Response, u: string) {
9191
let dataSource = [...tableListDataSource];
9292

9393
if (params.id) {
94-
dataSource = dataSource.filter((data) => data.id.includes(params.id || ''));
94+
dataSource = dataSource.filter((data) => data.id === params.id);
9595
}
9696
if (dataSource.length === 0) {
9797
return res.status(404).json({

mock/user.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ function showUser(req: Request, res: Response, u: string) {
122122
let dataSource = [...tableListDataSource];
123123

124124
if (params.id) {
125-
dataSource = dataSource.filter((data) => data.id.includes(params.id || ''));
125+
dataSource = dataSource.filter((data) => data.id === params.id);
126126
}
127127
if (dataSource.length === 0) {
128128
return res.status(404).json({

0 commit comments

Comments
 (0)