修改登录页面

This commit is contained in:
algerkong
2021-09-29 22:26:29 +08:00
parent a7f1453609
commit ba642e5003
4 changed files with 47 additions and 13 deletions
+5 -2
View File
@@ -39,7 +39,7 @@
<script lang="ts" setup>
import { getSearchKeyword, getHotSearch } from '@/api/home';
import { getUserDetail } from '@/api/login';
import { getUserDetail, logout } from '@/api/login';
import { onMounted, ref } from 'vue';
import { useRouter } from 'vue-router';
import { useStore } from 'vuex';
@@ -108,7 +108,10 @@ const selectItem = (key: any) => {
// switch 判断
switch (key) {
case 'logout':
store.state.user = null
logout().then(() => {
store.state.user = null
localStorage.clear()
})
break;
}
}