收藏
回答

云调用 openapi 失败,但是失败的情况各不相同,求解答?

const cloud = require('wx-server-sdk')
cloud.init({ // 初始化云开发环境
  env: cloud.DYNAMIC_CURRENT_ENV, // 当前环境的常量
}) 


初始化代码如上,调用不同的 API 以及对应的报错信息如下

// 调用 openapi analysis.getPerformanceData
const result = await cloud.openapi.analysis.getPerformanceData({
      name: 'analysis.getPerformanceData',
      data: {
        "time": {
          "endTimestamp": "1648252800000",
          "beginTimestamp": "1648166400000"
        },
        "module": '10022',
        "params": [
          {
            "field": 'networktype',
            "value": 'wifi'
          },
          {
            "field": 'device_level',
            "value": '1'
          },
          {
            "field": 'device',
            "value": '1'
          }
        ]
      }
    })
    return result
  } catch (e) {
    console.error(e)
  }

2、 analysis.getVisitPage


const result = await cloud.openapi.analysis.getVisitPage({
      "beginDate": '20220322',
      "endDate": '20120327'
    })


3、operation.getVersionList
const result = await cloud.openapi.operation.getVersionList({})


4、operation.getJsErrList
const result = await cloud.openapi.operation.getJsErrList({
      "appVersion": '0',
      "startTime": '2022-03-24',
      "endTime": '2022-03-25',
      "errType": '0',
      "openid": '',
      "keyword": '',
      "orderby": 'uv',
      "desc": '2',
      "offset": 0,
      "limit": 10
    })


回答关注问题邀请回答
收藏

2 个回答

登录 后发表内容