pagekit / vue-resource

The HTTP client for Vue.js
MIT License
10.08k stars 1.6k forks source link

change the url in Vue.http.interceptors with asynchronous methods #729

Closed SummerXIAhaha closed 4 years ago

SummerXIAhaha commented 5 years ago

I want change the request url in Vue.http.interceptors; but with a asynchronous methods; can i push a promise or async method in Vue.http.interceptors? how can I do that, please help me!

Vue.http.interceptors.push((request, next) => { // want change the request url with a async method.how can I get it? like setTimeout(() => { request.url = '1111'; }, 50) })