weaving
用 httpAPI 吧
!(async () => {
const mode = await httpAPI('/v1/outbound', 'GET')
console.log(mode)
})()
.catch(e => {
console.log(e)
})
.finally(() => $done({}))
function httpAPI(path = '', method = 'POST', body = null) {
return new Promise(resolve => {
$httpAPI(method, path, body, result => {
resolve(result)
})
})
}