美文网首页
Promise异步处理

Promise异步处理

作者: 小明的明 | 来源:发表于2019-12-03 16:33 被阅读0次

getinfo=()=>{

        new Promise(function(resolve,reject){

            axios.get("http://it.console.welfare.api-admin.suuyuu.cn/api/CorporateAccount/GetCorporateAccountInfo", {

                params: ''

            }).then((res)=>{

                if(res.code=="0"){

                    resolve(res)

                }else{

                    reject("错误了")

                }

            })

        }).then((res)=>{

            console.log(res)

        }).catch((msg)=>{

            console.log(msg)

        })

    }

相关文章

网友评论

      本文标题:Promise异步处理

      本文链接:https://www.haomeiwen.com/subject/zizcgctx.html