style: 统一代码格式和行尾

This commit is contained in:
leonincs
2026-05-20 16:34:19 +08:00
parent 0b87fd94cc
commit 732e284369
68 changed files with 7784 additions and 7781 deletions

View File

@@ -1,42 +1,42 @@
import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import HotView from '../views/HotView.vue'
import VideoView from '../views/VideoView.vue'
import VideoDetailView from '../views/VideoDetailView.vue'
import AccountView from '../views/AccountView.vue'
import ChangePasswordView from '../views/ChangePasswordView.vue'
import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import HotView from '../views/HotView.vue'
import VideoView from '../views/VideoView.vue'
import VideoDetailView from '../views/VideoDetailView.vue'
import AccountView from '../views/AccountView.vue'
import ChangePasswordView from '../views/ChangePasswordView.vue'
import RegisterView from '../views/RegisterView.vue'
import SettingsView from '../views/SettingsView.vue'
import UserProfileView from '../views/UserProfileView.vue'
import MessageView from '../views/MessageView.vue'
import { useAuthStore } from '../stores/auth'
const router = createRouter({
history: createWebHistory(),
routes: [
{ path: '/', name: 'home', component: HomeView },
{ path: '/feed', redirect: '/' },
{ path: '/hot', name: 'hot', component: HotView },
{ path: '/video', name: 'video', component: VideoView, meta: { requiresAuth: true } },
{ path: '/video/:id', name: 'video-detail', component: VideoDetailView, props: true },
{ path: '/account', name: 'account', component: AccountView },
{ path: '/account/register', name: 'account-register', component: RegisterView },
{ path: '/account/change-password', name: 'account-change-password', component: ChangePasswordView },
const router = createRouter({
history: createWebHistory(),
routes: [
{ path: '/', name: 'home', component: HomeView },
{ path: '/feed', redirect: '/' },
{ path: '/hot', name: 'hot', component: HotView },
{ path: '/video', name: 'video', component: VideoView, meta: { requiresAuth: true } },
{ path: '/video/:id', name: 'video-detail', component: VideoDetailView, props: true },
{ path: '/account', name: 'account', component: AccountView },
{ path: '/account/register', name: 'account-register', component: RegisterView },
{ path: '/account/change-password', name: 'account-change-password', component: ChangePasswordView },
{ path: '/settings', name: 'settings', component: SettingsView, meta: { requiresAuth: true } },
{ path: '/u/:id', name: 'user-profile', component: UserProfileView, props: true },
{ path: '/messages', name: 'message-list', component: MessageView, meta: { requiresAuth: true } },
{ path: '/messages/:peerId', name: 'messages', component: MessageView, meta: { requiresAuth: true } },
],
})
router.beforeEach((to, _from, next) => {
const auth = useAuthStore()
if (to.meta.requiresAuth && !auth.isLoggedIn) {
next({ path: '/account', query: { redirect: to.fullPath } })
return
}
next()
})
export default router
router.beforeEach((to, _from, next) => {
const auth = useAuthStore()
if (to.meta.requiresAuth && !auth.isLoggedIn) {
next({ path: '/account', query: { redirect: to.fullPath } })
return
}
next()
})
export default router