JS export 异步导出

function getUrl () {
  req().then(res => {
    console.log(res);

  }).catch(err => {
    console.log(err);

  })
}

export async function myReq () {

  await getUrl();

  return '123';

}

原文地址:https://www.cnblogs.com/Mr-Rshare/p/11540681.html