mirror of
https://github.com/Jinnrry/PMail.git
synced 2025-02-20 11:43:09 +08:00
用户状态同步修复 (#20)
Co-authored-by: jinnrry <jinnrry@users.noreply.github.com> Reviewed-on: http://192.168.123.5/jinnrry/PMail_Github/pulls/20
This commit is contained in:
parent
b1926807f2
commit
2e83ea3c9d
@ -26,10 +26,8 @@ http.interceptors.request.use((config) => {
|
||||
|
||||
//响应拦截器
|
||||
http.interceptors.response.use(async (response) => {
|
||||
const globalStatus = useGlobalStatusStore();
|
||||
//响应成功
|
||||
if (response.data.errorNo === 403) {
|
||||
globalStatus.isLogin = false
|
||||
|
||||
await router.replace({
|
||||
path: '/login',
|
||||
|
@ -28,8 +28,6 @@ import {useGlobalStatusStore} from "@/stores/useGlobalStatusStore";
|
||||
|
||||
const globalStatus = useGlobalStatusStore();
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
let isLogin = globalStatus.isLogin
|
||||
const userInfos = globalStatus.userInfos
|
||||
|
||||
const form = reactive({
|
||||
account: '',
|
||||
@ -41,8 +39,7 @@ const onSubmit = () => {
|
||||
if (res.errorNo !== 0) {
|
||||
ElMessage.error(res.errorMsg)
|
||||
} else {
|
||||
isLogin = true
|
||||
userInfos.value = res.data
|
||||
Object.assign(globalStatus.userInfos , res.data)
|
||||
router.replace({
|
||||
path: '/',
|
||||
query: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user