实现promise的另一种方式,ajax 顺序请求

 1       let url = './#/task/list/datapick'
 2         this.$http.get(url)
 3         .then(response => {
 4             console.log(response)
 5             return this.$http.get('./#/task/type')
 6           })
 7         .then(response =>{
 8           console.log(response)
 9           return this.$http.get('url2',{params:params})
10         })
11         .then(response =>{
12           console.log(response)
13            return this.$http.get('url3',{params:params})
14         })
15         .catch(response => {
16           console.log(response);
17         });

 

posted @ 2017-07-20 09:52  青鸟and飞鱼  阅读(325)  评论(0)    收藏  举报