修复退出登录

This commit is contained in:
luyuan 2020-10-30 14:49:01 +08:00
parent 8ded17d754
commit 1ea10e5a78
Signed by: theluyuan
GPG Key ID: A7972FD973317FF3

View File

@ -115,8 +115,10 @@
} }
</style> </style>
<script lang="ts"> <script lang="ts">
import { setToken } from '@/api/base';
import router from '@/router'; import router from '@/router';
import store from '@/store'; import store from '@/store';
import { saveValue } from '@/utils/common';
import { computed, defineComponent, ref } from 'vue'; import { computed, defineComponent, ref } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
@ -198,6 +200,8 @@ export default defineComponent({
function logout(): void{ function logout(): void{
store.commit("login", false) store.commit("login", false)
saveValue("token", "");
setToken();
router.replace("/"); router.replace("/");
} }