修复退出登录
This commit is contained in:
parent
8ded17d754
commit
1ea10e5a78
@ -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("/");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user