fix
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import axios from "axios"
|
import axios from "axios"
|
||||||
|
import { useAuthModalStore } from "shared/store/authModal"
|
||||||
import storage from "./storage"
|
import storage from "./storage"
|
||||||
import { STORAGE_KEY } from "./constants"
|
import { STORAGE_KEY } from "./constants"
|
||||||
|
|
||||||
@@ -13,6 +14,7 @@ http.interceptors.response.use(
|
|||||||
if (res.data.error) {
|
if (res.data.error) {
|
||||||
if (res.data.data && res.data.data.startsWith("Please login")) {
|
if (res.data.data && res.data.data.startsWith("Please login")) {
|
||||||
storage.remove(STORAGE_KEY.AUTHED)
|
storage.remove(STORAGE_KEY.AUTHED)
|
||||||
|
useAuthModalStore().openLoginModal()
|
||||||
}
|
}
|
||||||
return Promise.reject(res.data)
|
return Promise.reject(res.data)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user