feat: 初始化项目脚手架
This commit is contained in:
16
src/App.vue
Normal file
16
src/App.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<RouterView />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
// 根组件
|
||||
</script>
|
||||
|
||||
<style>
|
||||
#app {
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
}
|
||||
</style>
|
||||
9
src/assets/styles/main.css
Normal file
9
src/assets/styles/main.css
Normal file
@@ -0,0 +1,9 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
@layer base {
|
||||
body {
|
||||
@apply bg-gray-50 text-gray-900;
|
||||
}
|
||||
}
|
||||
17
src/constants/config.ts
Normal file
17
src/constants/config.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
// API 配置
|
||||
export const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || '/api'
|
||||
export const API_TIMEOUT = 15000
|
||||
|
||||
// 本地存储键
|
||||
export const STORAGE_KEYS = {
|
||||
ACCESS_TOKEN: 'access_token',
|
||||
REFRESH_TOKEN: 'refresh_token',
|
||||
USER_INFO: 'user_info'
|
||||
} as const
|
||||
|
||||
// 分页配置
|
||||
export const PAGINATION = {
|
||||
DEFAULT_PAGE: 1,
|
||||
DEFAULT_LIMIT: 20,
|
||||
MAX_LIMIT: 100
|
||||
} as const
|
||||
21
src/constants/enums.ts
Normal file
21
src/constants/enums.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
// 用户角色
|
||||
export enum UserRole {
|
||||
OWNER = 'owner',
|
||||
ADMIN = 'admin',
|
||||
MEMBER = 'member'
|
||||
}
|
||||
|
||||
// 预约状态
|
||||
export enum AppointmentStatus {
|
||||
OPEN = 'open',
|
||||
FULL = 'full',
|
||||
CANCELLED = 'cancelled',
|
||||
FINISHED = 'finished'
|
||||
}
|
||||
|
||||
// 游戏平台
|
||||
export enum GamePlatform {
|
||||
PC = 'PC',
|
||||
MOBILE = 'Mobile',
|
||||
CONSOLE = 'Console'
|
||||
}
|
||||
9
src/main.ts
Normal file
9
src/main.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { createApp } from 'vue'
|
||||
import App from './App.vue'
|
||||
|
||||
// 样式
|
||||
import './assets/styles/main.css'
|
||||
|
||||
const app = createApp(App)
|
||||
|
||||
app.mount('#app')
|
||||
16
src/types/api.ts
Normal file
16
src/types/api.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
// 统一响应格式
|
||||
export interface ApiResponse<T = any> {
|
||||
code: number
|
||||
message: string
|
||||
data: T
|
||||
timestamp: number
|
||||
}
|
||||
|
||||
// 分页响应
|
||||
export interface PageResponse<T> {
|
||||
items: T[]
|
||||
total: number
|
||||
page: number
|
||||
limit: number
|
||||
totalPages: number
|
||||
}
|
||||
21
src/types/appointment.ts
Normal file
21
src/types/appointment.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
export interface AppointmentInfo {
|
||||
id: string
|
||||
title: string
|
||||
startTime: string
|
||||
endTime: string
|
||||
currentParticipants: number
|
||||
maxParticipants: number
|
||||
status: 'open' | 'full' | 'cancelled' | 'finished'
|
||||
game: {
|
||||
id: string
|
||||
name: string
|
||||
coverUrl: string
|
||||
}
|
||||
group: {
|
||||
id: string
|
||||
name: string
|
||||
}
|
||||
isParticipant: boolean
|
||||
isCreator: boolean
|
||||
isFull: boolean
|
||||
}
|
||||
10
src/types/game.ts
Normal file
10
src/types/game.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
export interface GameInfo {
|
||||
id: string
|
||||
name: string
|
||||
coverUrl: string
|
||||
description?: string
|
||||
tags: string[]
|
||||
minPlayers: number
|
||||
maxPlayers: number
|
||||
platform: string
|
||||
}
|
||||
19
src/types/group.ts
Normal file
19
src/types/group.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
export interface GroupInfo {
|
||||
id: string
|
||||
name: string
|
||||
avatar: string
|
||||
description?: string
|
||||
currentMembers: number
|
||||
maxMembers: number
|
||||
myRole?: 'owner' | 'admin' | 'member'
|
||||
tags?: string[]
|
||||
createdAt?: string
|
||||
}
|
||||
|
||||
export interface CreateGroupParams {
|
||||
name: string
|
||||
description?: string
|
||||
avatar?: string
|
||||
maxMembers?: number
|
||||
tags?: string[]
|
||||
}
|
||||
12
src/types/user.ts
Normal file
12
src/types/user.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
export interface UserInfo {
|
||||
id: string
|
||||
username: string
|
||||
nickname?: string
|
||||
avatar?: string
|
||||
email?: string
|
||||
phone?: string
|
||||
role?: string
|
||||
isMember?: boolean
|
||||
isOnline?: boolean
|
||||
createdAt?: string
|
||||
}
|
||||
7
src/vite-env.d.ts
vendored
Normal file
7
src/vite-env.d.ts
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
declare module '*.vue' {
|
||||
import type { DefineComponent } from 'vue'
|
||||
const component: DefineComponent<{}, {}, any>
|
||||
export default component
|
||||
}
|
||||
Reference in New Issue
Block a user