| | |
| | | return Promise.reject(error) |
| | | }) |
| | | |
| | | const setCurrentUrl = () => { |
| | | if (!!(window.history && window.history.pushState)) { |
| | | window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login') |
| | | window.location.reload() |
| | | } |
| | | } |
| | | // const setCurrentUrl = () => { |
| | | // if (!!(window.history && window.history.pushState)) { |
| | | // window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login') |
| | | // window.location.reload() |
| | | // } |
| | | // } |
| | | |
| | | axios.interceptors.response.use((response) => { |
| | | if (response.data.ErrCode === 'LoginError') { |
| | | setCurrentUrl() |
| | | // setCurrentUrl() |
| | | } else { |
| | | return Promise.resolve(response.data) |
| | | } |