| | |
| | | */ |
| | | const httprequest = axios.create({ |
| | | baseURL: "http://121.196.36.24:8001/api/", |
| | | //timeout: 1000, |
| | | headers: { |
| | | token: "", |
| | | }, |
| | | timeout: 1000*10, |
| | | // headers: { |
| | | // token: "", |
| | | // }, |
| | | }); |
| | | |
| | | // 请求拦截器 |
| | |
| | | if (res.code === 401) { |
| | | window.location = `${window.logoutUrl}?url=${window.location.origin}`; |
| | | } |
| | | |
| | | if (res.code === '302') { |
| | | // console.log('123') |
| | | // 当code为300时进行一个提示 |
| | | if (res.code === '300') { |
| | | vant.Notify({ type: 'danger', message: res.Message }); |
| | | // vant.Toast({ type: 'danger', message: res.Message , position: 'top',}); |
| | | } |
| | | |
| | | return response; |