修复主界面进入异常

This commit is contained in:
tao
2025-12-31 16:38:54 +08:00
parent f724b40e24
commit a6fb67e374

View File

@@ -87,24 +87,11 @@
</template>
<script setup>
import { ref } from 'vue';
import { useRouter } from 'vue-router';
import { message } from 'ant-design-vue';
import { useAuthStore } from '@/store';
import { storeToRefs } from 'pinia';
const authStore = useAuthStore();
const { token } = storeToRefs(authStore);
const loggedIn = ref(Boolean(token.value));
const router = useRouter();
const handleJumpTo = (name) => {
if (!loggedIn.value) {
message.warning("尚未登录,请先登录");
return;
}
router.push({ name });
};
</script>