fix: 后端接口对接,问题修复。

This commit is contained in:
tianyongbao
2026-01-12 18:48:03 +08:00
parent 2e9609292e
commit 6d1a6ded2d
8 changed files with 281 additions and 55 deletions

View File

@@ -51,7 +51,7 @@ const API_PATHS = {
// 塘口列表模式1
POND_LIST: {
v1: '/fishery/pond/list',
v2: '/fishery/pond/list',
v2: '/fishery/pond/list_mode1',
},
// 塘口列表模式2
POND_LIST_MODE2: {
@@ -79,27 +79,22 @@ const API_PATHS = {
POND: {
// 新增塘口
ADD: {
v1: '/fishery/pond',
v2: '/fishery/pond',
},
// 修改塘口
UPDATE: {
v1: '/api/pond/update',
v2: '/fishery/pond',
},
// 删除塘口
DELETE: {
v1: '/api/pond/delete',
v2: '/fishery/pond',
},
// 鱼类列表
FISH_LIST: {
v1: '/fishery/fish/list',
v2: '/fishery/fish/list',
},
// 塘口基本数据
BASE_INFO: {
v1: '/api/pond/base_info',
v2: '/fishery/pond',
},
// 塘口下设备信息
@@ -124,7 +119,7 @@ const API_PATHS = {
// 设备列表
LIST_ALL: {
v1: '/api/device/list_all_device',
v2: '/fishery/device/list',
v2: '/fishery/device/list_all_device',
},
// 设备详情
INFO: {
@@ -168,7 +163,6 @@ const API_PATHS = {
},
// 检测设备是否在线
CHECK_STATUS: {
v1: '/api/device/check_device_status',
v2: '/iot/device/status',
},
// 盐度设置
@@ -183,7 +177,6 @@ const API_PATHS = {
},
// 添加水质检测仪
ADD_DETECTOR: {
v1: '/api/device/add_device_detector',
v2: '/iot/device/add_device_detector',
},
// 设置溶解氧/水温告警
@@ -209,7 +202,7 @@ const API_PATHS = {
// 添加控制一体机
ADD_CONTROLLER: {
v1: '/api/device/add_device_controller',
v2: '/fishery/device/controller',
v2: '/iot/device/add_device_controller',
},
// 启停溶解氧
SET_OXY_OPEN: {
@@ -329,17 +322,14 @@ const API_PATHS = {
MESSAGE: {
// 充值记录
PAY: {
v1: '/api/message/page_pay',
v2: '/fishery/payOrder/list',
},
// 报警记录
WARN: {
v1: '/api/message/page_warn',
v2: '/fishery/messageWarn/list',
},
// 开关记录
SWITCH: {
v1: '/api/message/page_op_record',
v2: '/fishery/messageOpRecord/list',
},
// 已读一条消息

View File

@@ -4,14 +4,12 @@ import Taro from '@tarojs/taro';
// 塘口模式1
export function getPond1() {
// 从本地存储获取手机号
const userKeyword = Taro.getStorageSync('Phone');
const queryParams = {
const userId = Taro.getStorageSync("UserId");
return httpService.get(API.HOME.POND_LIST(), {
params: {
userKeyword: userKeyword || undefined
rootUserId: userId || undefined
}
};
return httpService.get(API.HOME.POND_LIST(), { params: queryParams });
});
}
// 塘口模式2

View File

@@ -23,5 +23,6 @@ export function pondBaseInfo(data){
}
// 塘口下设备信息
export function pondDeviceInfo(data){
return httpService.post(API.POND.DEVICE_INFO(), {data})
// 后端接口GET /devices/{pondId},使用路径参数
return httpService.get(API.POND.DEVICE_INFO() + '/' + data.id)
}