修饰器
function arrest(target, calleeName, descriptor) { let oriFunc = descriptor.value; descriptor.value = function(...args){ return Promise.resolve(oriFunc.apply(this, args)) .then(res =>{ return Promise.resolve([null, res]); }) .catch(err => { return [err, null]; }); }; }; @arrest() async postFormId({habitID, type, formId}) { return await wx.$api.util.postFormId({habitID, type, formId}); },