login and auth

This commit is contained in:
hptangxi
2025-07-02 20:44:30 +08:00
parent 8e1de8d29f
commit 7b372de6d8
12 changed files with 113 additions and 87 deletions

View File

@@ -1,5 +1,10 @@
<script setup lang="ts">
import Logout from "@/components/Logout.vue";
import NavBar from "@/components/NavBar.vue";
</script>
<template>
<n-layout v-if="authService.isLoggedIn()">
<n-layout>
<n-layout-header class="flex items-center">
<h1 class="layout-header-title">T.COM</h1>
<nav-bar />
@@ -9,15 +14,8 @@
<router-view />
</n-layout-content>
</n-layout>
<router-view v-else />
</template>
<script setup lang="ts">
import NavBar from "@/components/NavBar.vue";
import Logout from "@/components/Logout.vue";
import { authService } from "@/services/auth";
</script>
<style scoped>
.layout-header-title {
margin-top: 0;