Skip to content

Commit

Permalink
feat: the login box pops up when the api interface returns 301
Browse files Browse the repository at this point in the history
  • Loading branch information
hq001 committed Dec 21, 2020
1 parent 236a761 commit 528d2ad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/utils/http.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Axios, { AxiosInstance, AxiosRequestConfig } from 'axios'
import { getNodeEnv } from '@/utils/index'
import store from '@/store/index'

// https://nklayman.github.io/vue-cli-plugin-electron-builder/guide/guide.html#serve-command
// The electron build process is in development mode
Expand Down Expand Up @@ -28,6 +29,9 @@ http.interceptors.response.use(
if (response.status === 200) {
return response.data
}
if (response.status === 301) {
store.commit('/Auth/SHOW_VIEW')
}
return response
},
error => {
Expand Down

0 comments on commit 528d2ad

Please sign in to comment.