Ver Fonte

历史数据测试

bobo04052021@163.com há 3 semanas atrás
pai
commit
f16bbac72d
1 ficheiros alterados com 4 adições e 10 exclusões
  1. 4 10
      pages/history/history.vue

+ 4 - 10
pages/history/history.vue

@@ -470,11 +470,10 @@ export default {
           .getDeviceHistory2(params)
           .then((response) => {
             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;
               uni.showModal({
                 title: "数据提示",
@@ -488,11 +487,6 @@ export default {
               });
             } else {
               resolve(response);
-              uni.showToast({
-                title: "请求失败",
-                icon: "none",
-                duration: 2000,
-              });
             }
           })
           .catch((error) => {