Commit 7c262512698785b10939176c10a9d845c1eb1d10
1 parent
fd842f76
fix: DEFECT-1006 query device list api throw 405
Showing
1 changed file
with
6 additions
and
3 deletions
| ... | ... | @@ -7,6 +7,7 @@ import type { |
| 7 | 7 | } from './model/alarmContactModal'; |
| 8 | 8 | import { getPageData } from '../../base'; |
| 9 | 9 | import { DeviceModel, DeviceQueryParam } from '../../device/model/deviceModel'; |
| 10 | +import { omit } from 'lodash-es'; | |
| 10 | 11 | enum API { |
| 11 | 12 | alarmContact = '/alarm_contact', |
| 12 | 13 | updateAlarmContact = '/alarm_contact/update', |
| ... | ... | @@ -50,8 +51,10 @@ export const saveOrEditAlarmContact = (params: ContactInfo, isUpdate: boolean) = |
| 50 | 51 | |
| 51 | 52 | // 查询设备分页数据 |
| 52 | 53 | export const devicePage = (params: DeviceQueryParam) => { |
| 53 | - return defHttp.get<DeviceModel>({ | |
| 54 | - url: API.devicePage, | |
| 55 | - params, | |
| 54 | + const { page, pageSize } = params; | |
| 55 | + const otherParams = omit(params, ['page', 'pageSize']); | |
| 56 | + return defHttp.post<DeviceModel>({ | |
| 57 | + url: `${API.devicePage}?page=${page}&pageSize=${pageSize}`, | |
| 58 | + params: otherParams, | |
| 56 | 59 | }); |
| 57 | 60 | }; | ... | ... |