コード例 #1
0
ファイル: ajax.js プロジェクト: junruchen/monkey-web
request.interceptors.response.use((res) => {
  if (res.data.status === 401) {
    // 用户未登录
    history.push('/login')
  }
  return res
}, (error) => {
コード例 #2
0
request.interceptors.response.use((res) => {
  if (res.data.status === 401) {
    message.error(res.data.message)
    history.push('/login')
  }
  return res
}, (error) => {
コード例 #3
0
request.interceptors.response.use((res) => {
  if (res.data.status === 401) {
    // 用户未登录
    history.push('/login')
    console.log('---', source)
    source.cancel('Operation canceled by the user.')
  }
  return res
}, (error) => {