From 1cbb519c927498af765101f645ebbdb16f5752c1 Mon Sep 17 00:00:00 2001 From: Mouriya Date: Mon, 19 Aug 2024 21:54:02 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=A8=E3=83=A9=E3=83=BC=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E3=81=97=E3=81=BE=E3=81=97=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/layouts/MainLayout.vue | 2 +- frontend/src/stores/useAuthStore.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/layouts/MainLayout.vue b/frontend/src/layouts/MainLayout.vue index 462ed91..4c346dd 100644 --- a/frontend/src/layouts/MainLayout.vue +++ b/frontend/src/layouts/MainLayout.vue @@ -19,7 +19,7 @@ -
+
diff --git a/frontend/src/stores/useAuthStore.ts b/frontend/src/stores/useAuthStore.ts index 7deb2cb..8887ddd 100644 --- a/frontend/src/stores/useAuthStore.ts +++ b/frontend/src/stores/useAuthStore.ts @@ -51,7 +51,7 @@ export const useAuthStore = defineStore('auth', { this.permissions = (tokenJson as any).permissions ?? 'user'; api.defaults.headers['Authorization'] = 'Bearer ' + this.token; this.currentDomain = await this.getCurrentDomain(); - this.userInfo = await this.getUserInfo(this.userId!); + this.userInfo = await this.getUserInfo(); router.push(this.returnUrl || '/'); return true; } catch (e) { @@ -76,8 +76,8 @@ export const useAuthStore = defineStore('auth', { kintoneUrl: data.url, })); }, - async getUserInfo(id:string):Promise{ - const resp = (await api.get(`api/v1/users/${id}`)).data; + async getUserInfo():Promise{ + const resp = (await api.get(`api/v1/users/me`)).data; return { firstName: resp.first_name, lastName: resp.last_name,