This commit is contained in:
2023-11-04 17:17:08 +09:00
5 changed files with 7 additions and 5 deletions

View File

@@ -28,7 +28,6 @@ export const useAuthStore = defineStore({
this.token =result.data.access_token;
this.name = result.data.user_name;
localStorage.setItem('token', result.data.access_token);
localStorage.setItem('id', result.data.user_id);
localStorage.setItem('name', result.data.user_name);
// const config = {headers:{Authorization : 'Bearer ' + this.token}};
api.defaults.headers["Authorization"]='Bearer ' + this.token;
@@ -46,7 +45,6 @@ export const useAuthStore = defineStore({
logout() {
this.token = null;
localStorage.removeItem('token');
localStorage.removeItem('id');
localStorage.removeItem('name');
localStorage.removeItem('domain');
Router.push('/login');