Token無効の際再ログイン対応
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { api } from 'boot/axios';
|
||||
import { Router } from '../router';
|
||||
|
||||
import {IDomainInfo} from '../types/ActionTypes';
|
||||
|
||||
|
||||
export interface IUserState{
|
||||
token?:string;
|
||||
returnUrl:string;
|
||||
@@ -35,7 +36,7 @@ export const useAuthStore = defineStore({
|
||||
api.defaults.headers["Authorization"]='Bearer ' + this.token;
|
||||
this.currentDomain=await this.getCurrentDomain();
|
||||
localStorage.setItem('currentDomain',JSON.stringify(this.currentDomain));
|
||||
Router.push(this.returnUrl || '/');
|
||||
this.router.push(this.returnUrl || '/');
|
||||
return true;
|
||||
}catch(e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user