Page 1 of 1

调用 getStatisticsRangDay报错

Posted: 2024年 Aug 1日 15:52
by youngclean
  • Tuya MiniApp Tools 版本信息:0.6.6; Minipack: 2.0.1
    • @ray-js/ray, @ray-js/panel-sdk的版本:1.5.12, 1.10.9
    • 移动设备信息:oppo 安卓~
    • 相关代码:

Code: Select all

const getTotalTime = () => {
    getStatisticsRangDay({
      devId:'6c42b12a15fab0c041c3b6',
      dpId: 120,
      startDay: '20240730',
      endDay: '20240731',
      type: 'minux',
    }).then(res => {
      console.log(res, 'getStatisticsRangDay');
    });
  }

Code: Select all

- 日志信息:

Code: Select all

service.js?side=service:3 SyntaxError: Uncaught (in promise) [object Object] (at service.js?side=service:3:386290)
    at new Be (service.js?side=service:3:386290)
    at Be.then (service.js?side=service:3:387583)
    at getTotalTime (index.tsx:159:8)
    at index.tsx:166:5
    at invokePassiveEffectCreate (react-reconciler.development.js:16054:20)
    at Object.invokeGuardedCallbackProd (react-reconciler.development.js:12101:10)
    at invokeGuardedCallback (react-reconciler.development.js:12292:31)
    at flushPassiveEffectsImpl (react-reconciler.development.js:16141:9)
    at unstable_runWithPriority (scheduler.development.js:468:12)
    at runWithPriority (react-reconciler.development.js:2495:10)

调用报错,请问这是什么问题?


Re: 调用 getStatisticsRangDay报错

Posted: 2024年 Aug 1日 16:43
by lshinylee

.catch 打印下具体 error 日志看看呢?


Re: 调用 getStatisticsRangDay报错

Posted: 2024年 Aug 1日 16:57
by youngclean

IDE 暂时还没实现 API apiRequestByHighway,请使用真机预览,或者真机调试


Re: 调用 getStatisticsRangDay报错

Posted: 2024年 Aug 2日 16:20
by youngclean

调用 getStatisticsRangMonth 报错

Code: Select all

{"errorCode": 40015, "errorMsg": "miniapp highway request error", "innerError": {"errorCode": "500", "errorMsg": "server busy"}}

代码是这样的:

Code: Select all

      getStatisticsRangMonth({
          devId: deviceId,
          dpId: 120,
          startMonth:'20240801',
          endMonth: '20240801',
          type: 'minus',
        })
          .then(response => {
            console.log(response, 'getStatisticsRangMonth');
            setHeatTotal(response[dateStr]);
          })
          .catch(e => {
            console.log(e, 'getStatisticsRangMonth heat error');
          });

Re: 调用 getStatisticsRangDay报错

Posted: 2024年 Aug 5日 15:52
by 18559697016
youngclean 2024年 Aug 1日 16:57

IDE 暂时还没实现 API apiRequestByHighway,请使用真机预览,或者真机调试

需要使用真机