Skip to content

Commit 62a4f5f

Browse files
committed
refactor: 适配后端删除接口重构,由 URL 传参重构为请求体传参
1 parent 987dddf commit 62a4f5f

File tree

14 files changed

+34
-29
lines changed

14 files changed

+34
-29
lines changed

src/apis/open/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function updateApp(data: any, id: string) {
2727

2828
/** @desc 删除应用 */
2929
export function deleteApp(id: string) {
30-
return http.del(`${BASE_URL}/${id}`)
30+
return http.del(`${BASE_URL}`, { ids: [id] })
3131
}
3232

3333
/** @desc 导出应用 */

src/apis/system/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ export function updateClient(data: any, id: string) {
2626
}
2727

2828
/** @desc 删除终端 */
29-
export function deleteClient(ids: string | Array<string>) {
30-
return http.del(`${BASE_URL}/${ids}`)
29+
export function deleteClient(id: string) {
30+
return http.del(`${BASE_URL}`, { ids: [id] })
3131
}

src/apis/system/dept.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function updateDept(data: any, id: string) {
2727

2828
/** @desc 删除部门 */
2929
export function deleteDept(id: string) {
30-
return http.del(`${BASE_URL}/${id}`)
30+
return http.del(`${BASE_URL}`, { ids: [id] })
3131
}
3232

3333
/** @desc 导出部门 */

src/apis/system/dict.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function updateDict(data: any, id: string) {
2727

2828
/** @desc 删除字典 */
2929
export function deleteDict(id: string) {
30-
return http.del(`${BASE_URL}/${id}`)
30+
return http.del(`${BASE_URL}`, { ids: [id] })
3131
}
3232

3333
/** @desc 清除字典缓存 */
@@ -57,5 +57,5 @@ export function updateDictItem(data: any, id: string) {
5757

5858
/** @desc 删除字典项 */
5959
export function deleteDictItem(id: string) {
60-
return http.del(`${BASE_URL}/item/${id}`)
60+
return http.del(`${BASE_URL}/item`, { ids: [id] })
6161
}

src/apis/system/file.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ export function updateFile(data: any, id: string) {
1616
}
1717

1818
/** @desc 删除文件 */
19-
export function deleteFile(ids: string | Array<string>) {
20-
return http.del(`${BASE_URL}/${ids}`)
19+
export function deleteFile(id: string) {
20+
return http.del(`${BASE_URL}`, { ids: [id] })
2121
}
2222

2323
/** @desc 查询文件资源统计统计 */

src/apis/system/menu.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function updateMenu(data: any, id: string) {
2727

2828
/** @desc 删除菜单 */
2929
export function deleteMenu(id: string) {
30-
return http.del(`${BASE_URL}/${id}`)
30+
return http.del(`${BASE_URL}`, { ids: [id] })
3131
}
3232

3333
/** @desc 清除菜单缓存 */

src/apis/system/message.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,18 @@ export function listMessage(query: T.MessagePageQuery) {
1111
}
1212

1313
/** @desc 删除消息 */
14-
export function deleteMessage(ids: string | Array<string>) {
15-
return http.del(`${BASE_URL}/${ids}`)
14+
export function deleteMessage(ids: Array<string>) {
15+
return http.del(`${BASE_URL}`, { ids })
1616
}
1717

1818
/** @desc 标记已读 */
19-
export function readMessage(ids?: string | Array<string>) {
20-
return http.patch(`${BASE_URL}/read`, ids)
19+
export function readMessage(ids?: Array<string>) {
20+
return http.patch(`${BASE_URL}/read`, { ids })
21+
}
22+
23+
/** @desc 全部已读 */
24+
export function readAllMessage() {
25+
return http.patch(`${BASE_URL}/readAll`)
2126
}
2227

2328
/** @desc 查询未读消息数量 */

src/apis/system/notice.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ export function updateNotice(data: any, id: string) {
2626
}
2727

2828
/** @desc 删除公告 */
29-
export function deleteNotice(ids: string | Array<number>) {
30-
return http.del(`${BASE_URL}/${ids}`)
29+
export function deleteNotice(id: string) {
30+
return http.del(`${BASE_URL}`, { ids: [id] })
3131
}

src/apis/system/role.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ export function updateRole(data: any, id: string) {
2626
}
2727

2828
/** @desc 删除角色 */
29-
export function deleteRole(ids: string | Array<string>) {
30-
return http.del(`${BASE_URL}/${ids}`)
29+
export function deleteRole(id: string) {
30+
return http.del(`${BASE_URL}`, { ids: [id] })
3131
}
3232

3333
/** @desc 修改角色权限 */

src/apis/system/smsConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ export function updateSmsConfig(data: any, id: string) {
2727

2828
/** @desc 删除短信配置 */
2929
export function deleteSmsConfig(id: string) {
30-
return http.del(`${BASE_URL}/${id}`)
30+
return http.del(`${BASE_URL}`, { ids: [id] })
3131
}

0 commit comments

Comments
 (0)