云函数调用阿里的SDK一直连接超时RequestTimeoutError,请问怎么解决?
const cloud = require('wx-server-sdk')
cloud.init()
const Core = require('[@alicloud](/user/alicloud)/pop-core');
var client = new Core({
accessKeyId: '',
accessKeySecret: '',
endpoint: 'https://dyplsapi.aliyuncs.com',
apiVersion: '2017-05-25'
});
var RegionId = "cn-hangzhou";
var PoolKey = "";
// 云函数入口函数
exports.main = async (event, context) => {
var bindParams = {
"RegionId": RegionId,
"PhoneNoA": event.PhoneNoA,
"Expiration": "2021-01-22 15:09",
"PoolKey": PoolKey,
"PhoneNoB": event.PhoneNoB,
"IsRecordingEnabled":false
}
var res = await client.request('BindAxb', bindParams, {method: 'POST'}).then((result) => {
console.log(result);
return JSON.stringify(result);
}, (ex) => {
console.log(ex);
})
return res;
}
1 回复
RequestTimeoutError: ReadTimeout: 3000. POST / failed. at makeReadTimeoutError (F:\temp\call\functions\bindAxB\node_modules\httpx\lib\index.js:187:17) at Timeout._onTimeout (F:\temp\call\functions\bindAxB\node_modules\httpx\lib\index.js:206:14) at listOnTimeout (internal/timers.js:531:17) at processTimers (internal/timers.js:475:7)