king
2019-12-06 2cb65d99c9aebf8293cb2838fcfe3e09fb2739ce
src/api/index.js
@@ -22,16 +22,16 @@
  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)
  }