Commit 9305982c87a17ce8bb9b3f772c064bc28ba048f0

Authored by fengtao
1 parent c9c55893

perf: 角色为平台管理员,则不调用退出登录接口

Showing 1 changed file with 5 additions and 1 deletions
@@ -28,6 +28,7 @@ import { RouteRecordRaw } from 'vue-router'; @@ -28,6 +28,7 @@ import { RouteRecordRaw } from 'vue-router';
28 import { PAGE_NOT_FOUND_ROUTE } from '/@/router/routes/basic'; 28 import { PAGE_NOT_FOUND_ROUTE } from '/@/router/routes/basic';
29 import { createLocalStorage } from '/@/utils/cache/index'; 29 import { createLocalStorage } from '/@/utils/cache/index';
30 import { getEntitiesId } from '/@/api/dashboard/index'; 30 import { getEntitiesId } from '/@/api/dashboard/index';
  31 +import { useRole } from '/@/hooks/business/useRole';
31 32
32 interface PlatInfoType { 33 interface PlatInfoType {
33 id: string; 34 id: string;
@@ -283,7 +284,10 @@ export const useUserStore = defineStore({ @@ -283,7 +284,10 @@ export const useUserStore = defineStore({
283 title: t('sys.app.logoutTip'), 284 title: t('sys.app.logoutTip'),
284 content: t('sys.app.logoutMessage'), 285 content: t('sys.app.logoutMessage'),
285 onOk: async () => { 286 onOk: async () => {
286 - await logoutApi(null, 'modal'); //新增退出登录接口 287 + const { isPlatformAdmin } = useRole();
  288 + if (!isPlatformAdmin.value) {
  289 + await logoutApi(null, 'modal'); //新增退出登录接口
  290 + }
287 await this.logout(true); 291 await this.logout(true);
288 }, 292 },
289 }); 293 });