hbuild将vue项目打包成app出错

使用vue-cli创建的vue项目,使用npm命令行进行项目打包生成了dist文件,
使用hbuild将dist文件打包成app的时候,能正常打包,生成的apk也能正常访问,
但是在进行接口访问的时候,报错Unhandled promise rejection,
错误代码:
"Unhandled promise rejection" /dist/static/js/vendor.bcf70c3412c5c5ae31de.js (12)

https://segmentfault.com/q/1010000014866742
当Promise 的状态变为rejection 时没有正确处理,让其一直冒泡(propagation),直至被进程捕获。这个 Promise 就被称为 unhandled promise rejection。

// 方式一 .then(undefined, () => {})
new Promise((resolve, reject) => {
  // ...
  reject('timeout');
}).then(undefined, (error) => {
  console.error(error);
});

// 方式二 .catch(() => {})
new Promise((resolve, reject) => {
  // ...
  reject('timeout')
}).catch((error) => {
  console.error(error);
})