axios顺序执行

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/taotaox/article/details/79098470

“`
axios.post(‘https://olor ‘, that.funThreeData,
{responseType: ‘json’})
.then(function (response) {
return response;
console.log(response);
})
.then(function(re){

           /**
                         * 第二步
                         */
                        that.$refs.uiloading.Hide();
                        //返回处理添加花色面料   (因为不验证花色面料添加是否成功)
                        if(re.code==='FAIL' || re.code==='SUCCESS'){
                            console.log("第一步的message:"+re.message);

                            axios.post('http', that.funOneData,
                                {responseType: 'json'})
                                .then(function (response) {
                                    console.log("第二步的message:"+response.message);
                                    //返回处理
                                    if(response.code==='FAIL'){
                                        that.$refs.uinotify.Open("err:"+response.message);
                                    }
                                    else{
                                        that.funOneData.cinvcode = null;
                                        that.funOneData.fabric = null;
                                        that.$refs.uinotify.Open(response.message);
                                    }
                                    console.log(response);
                                })
                                .catch(function (error) {
                                    that.$refs.uiloading.Hide();
                                    that.$refs.uinotify.Open('未知错误');
                                    console.log(error);
                                });
                              ```
展开阅读全文

没有更多推荐了,返回首页