修复退出登录
This commit is contained in:
parent
8ded17d754
commit
1ea10e5a78
@ -115,8 +115,10 @@
|
||||
}
|
||||
</style>
|
||||
<script lang="ts">
|
||||
import { setToken } from '@/api/base';
|
||||
import router from '@/router';
|
||||
import store from '@/store';
|
||||
import { saveValue } from '@/utils/common';
|
||||
import { computed, defineComponent, ref } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
@ -198,6 +200,8 @@ export default defineComponent({
|
||||
|
||||
function logout(): void{
|
||||
store.commit("login", false)
|
||||
saveValue("token", "");
|
||||
setToken();
|
||||
router.replace("/");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user