|
@@ -470,11 +470,10 @@ export default {
|
|
.getDeviceHistory2(params)
|
|
.getDeviceHistory2(params)
|
|
.then((response) => {
|
|
.then((response) => {
|
|
if (response.data.code == 200) {
|
|
if (response.data.code == 200) {
|
|
- this.historyData =
|
|
|
|
- (response.data &&
|
|
|
|
- response.data.result &&
|
|
|
|
- response.data.result.records) ||
|
|
|
|
- [];
|
|
|
|
|
|
+ const result = response.data?.result || {};
|
|
|
|
+ this.historyData = Array.isArray(result.records)
|
|
|
|
+ ? result.records
|
|
|
|
+ : [];
|
|
// this.pageNo = response.data.result.datalist.current;
|
|
// this.pageNo = response.data.result.datalist.current;
|
|
uni.showModal({
|
|
uni.showModal({
|
|
title: "数据提示",
|
|
title: "数据提示",
|
|
@@ -488,11 +487,6 @@ export default {
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
resolve(response);
|
|
resolve(response);
|
|
- uni.showToast({
|
|
|
|
- title: "请求失败",
|
|
|
|
- icon: "none",
|
|
|
|
- duration: 2000,
|
|
|
|
- });
|
|
|
|
}
|
|
}
|
|
})
|
|
})
|
|
.catch((error) => {
|
|
.catch((error) => {
|