From 544f91e63a01f37e7b79db99609eec99b1afafd9 Mon Sep 17 00:00:00 2001
From: Mila <Mila@pollex.com.tw>
Date: 星期一, 13 十二月 2021 11:07:31 +0800
Subject: [PATCH] fixed: 使用 isUserLogin / isAdminLogin 判斷顧問/客戶是否登入

---
 PAMapp/store/localStorage.ts |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/PAMapp/store/localStorage.ts b/PAMapp/store/localStorage.ts
index d93aa2c..84f5bb0 100644
--- a/PAMapp/store/localStorage.ts
+++ b/PAMapp/store/localStorage.ts
@@ -1,5 +1,6 @@
 import { Selected } from '~/components/QuickFilter/QuickFilterSelector.vue';
 import { Module, Mutation, VuexModule ,Action } from 'vuex-module-decorators';
+import { Role } from '~/assets/ts/models/enum/Role';
 @Module
 export default class LocalStorage extends VuexModule {
   id_token = localStorage.getItem('id_token');
@@ -24,6 +25,14 @@
     return JSON.parse(this.quickFilterSelectedItem || '[]') as Selected[];
   }
 
+  get isAdminLogin(): boolean {
+    return this.currentRole === Role.ADMIN;
+  }
+
+  get isUserLogin(): boolean {
+    return this.currentRole === Role.USER;
+  }
+
 
 
   @Mutation storageIdToken(token: string): void {

--
Gitblit v1.8.0