mirror of
				https://github.com/soybeanjs/soybean-admin.git
				synced 2025-11-04 15:53:43 +08:00 
			
		
		
		
	fix(projects): fix tabs data when role is change. fixed #392
This commit is contained in:
		@@ -1,13 +1,17 @@
 | 
			
		||||
<script setup lang="ts">
 | 
			
		||||
import { computed, ref } from 'vue';
 | 
			
		||||
import { useRoute } from 'vue-router';
 | 
			
		||||
import { useLoading } from '@sa/hooks';
 | 
			
		||||
import { $t } from '@/locales';
 | 
			
		||||
import { useAppStore } from '@/store/modules/app';
 | 
			
		||||
import { useAuthStore } from '@/store/modules/auth';
 | 
			
		||||
import { useTabStore } from '@/store/modules/tab';
 | 
			
		||||
import { useAuth } from '@/hooks/business/auth';
 | 
			
		||||
 | 
			
		||||
const route = useRoute();
 | 
			
		||||
const appStore = useAppStore();
 | 
			
		||||
const authStore = useAuthStore();
 | 
			
		||||
const tabStore = useTabStore();
 | 
			
		||||
const { hasAuth } = useAuth();
 | 
			
		||||
const { loading, startLoading, endLoading } = useLoading();
 | 
			
		||||
 | 
			
		||||
@@ -48,6 +52,7 @@ async function handleToggleAccount(account: Account) {
 | 
			
		||||
 | 
			
		||||
  startLoading();
 | 
			
		||||
  await authStore.login(account.userName, account.password, false);
 | 
			
		||||
  tabStore.initTabStore(route);
 | 
			
		||||
  endLoading();
 | 
			
		||||
  appStore.reloadPage();
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user