修复主界面进入异常
This commit is contained in:
@@ -87,24 +87,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
|
||||||
import { useRouter } from 'vue-router';
|
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 router = useRouter();
|
||||||
|
|
||||||
const handleJumpTo = (name) => {
|
const handleJumpTo = (name) => {
|
||||||
if (!loggedIn.value) {
|
|
||||||
message.warning("尚未登录,请先登录");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
router.push({ name });
|
router.push({ name });
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user