fix(projects): 修复登录的重定向地址

This commit is contained in:
Soybean
2021-09-16 13:58:11 +08:00
parent c1cdc3a9ed
commit f97f226656
24 changed files with 261 additions and 174 deletions

View File

@ -10,15 +10,12 @@
<script lang="ts" setup>
import { NDropdown, NAvatar } from 'naive-ui';
import { UserAvatar, Logout } from '@vicons/carbon';
import { dynamicIconRender } from '@/utils';
import { dynamicIconRender, resetAuthStorage } from '@/utils';
import HeaderItem from './HeaderItem.vue';
import avatar from '@/assets/img/common/logo-fill.png';
import { useAuthStore } from '@/store';
type DropdownKey = 'user-center' | 'logout';
const { resetAuthState } = useAuthStore();
const options = [
{
label: '用户中心',
@ -39,7 +36,8 @@ const options = [
function handleDropdown(optionKey: string) {
const key = optionKey as DropdownKey;
if (key === 'logout') {
resetAuthState();
resetAuthStorage();
window.location.reload();
}
}
</script>