Promisfy for dingtalk.
npm install -S @jswork/next-dd-promisfy
import '@jswork/next-dd-promisfy';
const getPhoneInfo = nx.ddPromisfy(dd.device.base.getPhoneInfo, { context: dd.device.base });
// call the promisfy function
getPhoneInfo()
.then(res=>{
console.log(res);
}).catch(err=>{
console.log(err);
});
Code released under the MIT license.