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
})