uni-request-fun

1.0.1 • Public • Published

uni-request-app

基于Promise封装uni-app的request方法

asycn await

  const uniRequest = async (url,param,method) =>{
    const [err, data] = await awaitWrap(http(url,param,method))
    const obj = {err,data}
    return obj
}

返回的是个promise对象 
用法: 
    
    if (!data.err) return; // 错误判断
    this.info = data.data

致谢 && 参考

License

MIT

Package Sidebar

Install

npm i uni-request-fun

Weekly Downloads

0

Version

1.0.1

License

ISC

Unpacked Size

2.19 kB

Total Files

3

Last publish

Collaborators

  • liujia1130