fix: java后端接口对接,联调测试问题修改。

This commit is contained in:
tianyongbao
2026-01-15 11:34:03 +08:00
parent f5ddf1e120
commit b1bc6c174c
16 changed files with 216 additions and 126 deletions

View File

@@ -490,8 +490,19 @@ function getCheckDevice() {
state.show = true;
state.msg = "设备异常";
}
} else {
// 显示错误提示
state.show = true;
state.msg = res.msg || "检查设备失败,请重试";
state.type = "fail";
}
})
.catch((error) => {
// 处理网络错误等异常情况
state.show = true;
state.msg = "网络错误,请重试";
state.type = "fail";
})
.finally(() => {
isLoading.value = false;
});
@@ -549,7 +560,17 @@ function next() {
Taro.redirectTo({
url: "/my/addDevSuccess?name=添加测控一体机&page=" + page,
});
} else {
// 显示错误提示
state.show = true;
state.msg = res.msg || "添加失败,请重试";
state.type = "fail";
}
}).catch((error) => {
// 处理网络错误等异常情况
state.show = true;
state.msg = "网络错误,请重试";
state.type = "fail";
});
} else {
if (num != 1 && status.value == 1) {

View File

@@ -370,8 +370,19 @@ function getCheckDevice() {
state.show = true;
state.msg = "设备异常";
}
} else {
// 显示错误提示
state.show = true;
state.msg = res.msg || "检查设备失败,请重试";
state.type = "fail";
}
})
.catch((error) => {
// 处理网络错误等异常情况
state.show = true;
state.msg = "网络错误,请重试";
state.type = "fail";
})
.finally(() => {
isLoading.value = false;
});
@@ -423,8 +434,19 @@ function next() {
Taro.redirectTo({
url: "/my/addDevSuccess?name=添加水质检测仪&page=" + page,
});
} else {
// 显示错误提示
state.show = true;
state.msg = res.msg || "添加失败,请重试";
state.type = "fail";
}
})
.catch((error) => {
// 处理网络错误等异常情况
state.show = true;
state.msg = "网络错误,请重试";
state.type = "fail";
})
.finally(() => {
isLoading.value = false;
});

View File

@@ -149,7 +149,7 @@ Taro.useDidShow(() => {
// 获取报警电话列表
function getWarnPhoneList() {
warnPhoneList().then((res: any) => {
if (res.statusCode == 200) {
if (res.code == 200) {
phoneList.value = res.data;
phone1.value = res.data[0] ? res.data[0] : "";
phone2.value = res.data[1] ? res.data[1] : "";
@@ -203,9 +203,11 @@ function save() {
};
isLoading.value = true
updateWarnPhone(params).then((res: any) => {
if (res.statusCode == 200) {
if (res.code == 200) {
state.type = "success";
state.show = true;
state.msg = "保存成功";
getWarnPhoneList();
}
}).finally(()=>{
isLoading.value = false

View File

@@ -255,8 +255,9 @@ Taro.useDidShow(() => {
});
// 设备列表
function getDeviceList() {
allDeviceList({ type: 1 }).then((res: any) => {
if (res.statusCode == 200) {
const userId = Taro.getStorageSync("UserId");
allDeviceList({ type: 1,rootUserId:userId }).then((res: any) => {
if (res.code == 200) {
deviceList.value = res.data;
}
});
@@ -288,7 +289,7 @@ function removeDev(id: number) {
success: function (res) {
if (res.confirm) {
deviceUnbind({ id }).then((res) => {
if (res.statusCode == 200) {
if (res.code == 200) {
state.show = true;
state.msg = "移除成功";
getDeviceList();
@@ -323,7 +324,7 @@ function goScan() {
success: (res) => {
const result = res.result;
deviceScan({ qrcode: result }).then((v) => {
if (v.statusCode == 200) {
if (v.code == 200) {
params.devType = String(v.data.deviceType);
params.devNum = v.data.serialNum;
alertShow.value = false;
@@ -372,7 +373,7 @@ function submit() {
// 查询塘口列表
function getPondList() {
getPond2().then((res: any) => {
if (res.statusCode == 200) {
if (res.code == 200) {
pondList.value = res.data;
if (pondId) {
params.pondName = res.data.find((r) => r.id == pondId)?.["pondName"];

View File

@@ -170,7 +170,7 @@ function del(id) {
content: "确认删除该子账号!",
success: function (res) {
if (res.confirm) {
delete_user_child({ id }).then((res: any) => {
delete_user_child(id).then((res: any) => {
if (res.statusCode == 200) {
state.show = true;
state.msg = "删除成功";