This commit is contained in:
yuanteng 2024-10-27 20:30:10 +08:00
parent a7f8bbbc1f
commit 1bb5c652c7
2 changed files with 17 additions and 4 deletions

View File

@ -120,14 +120,27 @@
import {ref} from 'vue'
import emitter from '@/utils/emitter'
import {useRoute, useRouter} from "vue-router";
import myAxios from '@/api/myAxios';
import { userStore } from '@/store/userStore';
import { ElMessage } from 'element-plus';
const router = useRouter();
const route = useRoute();
const offset = ref(20)
const showLog = ref(false)
const store = userStore()
const logout = () => {
router.push('/')
const logout = async () => {
const res: any = await myAxios.post("/user/logout",{})
console.log(res)
if(res.data.code == 1 && res.data) {
store.$reset()
await router.replace('/')
ElMessage({
type: 'info',
message: '登出成功',
})
}
}
const changeState = () => {
showLog.value = !showLog.value

View File

@ -309,7 +309,7 @@ const handleDelete = (index: number, row: any) => {
};
const tableData = [
const tableData = ref([
{
selectedItems: '001',
img: 'https://s21.ax1x.com/2024/10/24/pAdzjZ6.png',
@ -323,7 +323,7 @@ const tableData = [
desc: '描述',
attribute:'下架',
},
];
]);
const list = {
region: '',
label: [],