Skip to content

Commit c53673a

Browse files
committed
feat: 完成 HaloLight Vue 3.5 版本完整实现
- 基于 Vue 3.5 + Vite + TypeScript 构建 - Pinia 状态管理 + TanStack Query 数据获取 - 完整认证流程 (登录/注册/忘记/重置密码) - 可拖拽仪表盘 (grid-layout-plus) - 主题切换 (light/dark/system + 11 skins) - shadcn-vue 组件库 - CI/CD (lint/type-check/test/build)
1 parent e5ad968 commit c53673a

208 files changed

Lines changed: 24170 additions & 719 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.development

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# =============================================================================
2+
# 开发环境变量配置
3+
# =============================================================================
4+
5+
# -----------------------------------------------------------------------------
6+
# 基础配置
7+
# -----------------------------------------------------------------------------
8+
9+
# API 基础 URL
10+
VITE_API_URL=/api
11+
12+
# 启用 Mock 数据(开发模式)
13+
VITE_MOCK=true
14+
15+
# -----------------------------------------------------------------------------
16+
# 演示账号配置(仅开发环境)
17+
# -----------------------------------------------------------------------------
18+
19+
# 演示账号邮箱
20+
VITE_DEMO_EMAIL=admin@halolight.h7ml.cn
21+
22+
# 演示账号密码
23+
VITE_DEMO_PASSWORD=123456
24+
25+
# 显示演示账号提示
26+
VITE_SHOW_DEMO_HINT=true
27+
28+
# -----------------------------------------------------------------------------
29+
# WebSocket 配置
30+
# -----------------------------------------------------------------------------
31+
32+
# WebSocket 服务器地址
33+
VITE_WS_URL=ws://localhost:3001
34+
35+
# -----------------------------------------------------------------------------
36+
# 应用配置
37+
# -----------------------------------------------------------------------------
38+
39+
# 应用标题
40+
VITE_APP_TITLE=Admin Pro - Dev
41+
42+
# 品牌名称
43+
VITE_BRAND_NAME=Halolight

.env.example

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# =============================================================================
2+
# Admin Pro Vue 环境变量配置
3+
# =============================================================================
4+
# 复制此文件为 .env.local 并填写实际值
5+
6+
# -----------------------------------------------------------------------------
7+
# 基础配置
8+
# -----------------------------------------------------------------------------
9+
10+
# API 基础 URL(默认 /api)
11+
VITE_API_URL=/api
12+
13+
# 是否启用 Mock 数据(开发模式,true/false)
14+
VITE_MOCK=true
15+
16+
# -----------------------------------------------------------------------------
17+
# 演示账号配置(仅开发/演示环境使用,生产环境请移除)
18+
# -----------------------------------------------------------------------------
19+
20+
# 演示账号邮箱
21+
VITE_DEMO_EMAIL=admin@example.com
22+
23+
# 演示账号密码
24+
VITE_DEMO_PASSWORD=123456
25+
26+
# 是否显示演示账号提示
27+
VITE_SHOW_DEMO_HINT=true
28+
29+
# -----------------------------------------------------------------------------
30+
# WebSocket 配置
31+
# -----------------------------------------------------------------------------
32+
33+
# WebSocket 服务器地址
34+
VITE_WS_URL=ws://localhost:3001
35+
36+
# -----------------------------------------------------------------------------
37+
# 可选配置
38+
# -----------------------------------------------------------------------------
39+
40+
# 应用标题
41+
VITE_APP_TITLE=Admin Pro
42+
43+
# 公司/品牌名称
44+
VITE_BRAND_NAME=Admin Pro
45+
46+
# 分析/统计 ID(如 Google Analytics)
47+
# VITE_GA_ID=
48+
49+
# Sentry DSN(错误追踪)
50+
# VITE_SENTRY_DSN=

.env.production

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# =============================================================================
2+
# 生产环境变量配置
3+
# =============================================================================
4+
5+
# -----------------------------------------------------------------------------
6+
# 基础配置
7+
# -----------------------------------------------------------------------------
8+
9+
# API 基础 URL(生产环境使用实际 API 地址)
10+
VITE_API_URL=/api
11+
12+
# 禁用 Mock 数据
13+
VITE_MOCK=false
14+
15+
# -----------------------------------------------------------------------------
16+
# 演示账号配置(生产环境建议关闭或使用安全账号)
17+
# -----------------------------------------------------------------------------
18+
19+
# 演示账号邮箱
20+
VITE_DEMO_EMAIL=admin@halolight.h7ml.cn
21+
22+
# 演示账号密码
23+
VITE_DEMO_PASSWORD=123456
24+
25+
# 隐藏演示账号提示
26+
VITE_SHOW_DEMO_HINT=false
27+
28+
# -----------------------------------------------------------------------------
29+
# WebSocket 配置
30+
# -----------------------------------------------------------------------------
31+
32+
# WebSocket 服务器地址(生产环境使用实际地址)
33+
VITE_WS_URL=wss://ws.halolight.h7ml.cn
34+
35+
# -----------------------------------------------------------------------------
36+
# 应用配置
37+
# -----------------------------------------------------------------------------
38+
39+
# 应用标题
40+
VITE_APP_TITLE=Admin Pro
41+
42+
# 品牌名称
43+
VITE_BRAND_NAME=Halolight

.github/workflows/ci.yml

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master, main, develop]
6+
pull_request:
7+
branches: [master, main, develop]
8+
workflow_dispatch:
9+
10+
# 取消同一分支的之前运行,节省资源
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
env:
16+
NODE_VERSION: "20"
17+
PNPM_VERSION: "10.23.0"
18+
VITE_API_URL: /api
19+
VITE_MOCK: "true"
20+
CI: "true"
21+
22+
jobs:
23+
# ============================================================================
24+
# 代码质量检查
25+
# ============================================================================
26+
lint:
27+
name: Lint & Type Check
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v4
32+
33+
- name: Setup pnpm
34+
uses: pnpm/action-setup@v4
35+
with:
36+
version: ${{ env.PNPM_VERSION }}
37+
run_install: false
38+
39+
- name: Setup Node.js
40+
uses: actions/setup-node@v4
41+
with:
42+
node-version: ${{ env.NODE_VERSION }}
43+
cache: "pnpm"
44+
45+
- name: Get pnpm store path
46+
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
47+
48+
- name: Cache pnpm store
49+
uses: actions/cache@v4
50+
with:
51+
path: ${{ env.STORE_PATH }}
52+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
53+
restore-keys: |
54+
${{ runner.os }}-pnpm-store-
55+
56+
- name: Install dependencies
57+
run: pnpm install --frozen-lockfile
58+
59+
- name: Run ESLint
60+
run: pnpm lint
61+
62+
- name: Run TypeScript type check
63+
run: pnpm type-check
64+
65+
# ============================================================================
66+
# 单元测试
67+
# ============================================================================
68+
test:
69+
name: Unit Tests
70+
runs-on: ubuntu-latest
71+
needs: lint
72+
steps:
73+
- name: Checkout repository
74+
uses: actions/checkout@v4
75+
76+
- name: Setup pnpm
77+
uses: pnpm/action-setup@v4
78+
with:
79+
version: ${{ env.PNPM_VERSION }}
80+
run_install: false
81+
82+
- name: Setup Node.js
83+
uses: actions/setup-node@v4
84+
with:
85+
node-version: ${{ env.NODE_VERSION }}
86+
cache: "pnpm"
87+
88+
- name: Get pnpm store path
89+
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
90+
91+
- name: Cache pnpm store
92+
uses: actions/cache@v4
93+
with:
94+
path: ${{ env.STORE_PATH }}
95+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
96+
restore-keys: |
97+
${{ runner.os }}-pnpm-store-
98+
99+
- name: Install dependencies
100+
run: pnpm install --frozen-lockfile
101+
102+
- name: Run tests with coverage
103+
run: pnpm test:coverage
104+
continue-on-error: true
105+
106+
- name: Upload coverage to Codecov
107+
uses: codecov/codecov-action@v4
108+
if: always()
109+
with:
110+
token: ${{ secrets.CODECOV_TOKEN }}
111+
fail_ci_if_error: false
112+
files: ./coverage/lcov.info
113+
flags: unittests
114+
name: codecov-umbrella
115+
116+
# ============================================================================
117+
# 构建检查
118+
# ============================================================================
119+
build:
120+
name: Build
121+
runs-on: ubuntu-latest
122+
needs: lint
123+
steps:
124+
- name: Checkout repository
125+
uses: actions/checkout@v4
126+
127+
- name: Setup pnpm
128+
uses: pnpm/action-setup@v4
129+
with:
130+
version: ${{ env.PNPM_VERSION }}
131+
run_install: false
132+
133+
- name: Setup Node.js
134+
uses: actions/setup-node@v4
135+
with:
136+
node-version: ${{ env.NODE_VERSION }}
137+
cache: "pnpm"
138+
139+
- name: Get pnpm store path
140+
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
141+
142+
- name: Cache pnpm store
143+
uses: actions/cache@v4
144+
with:
145+
path: ${{ env.STORE_PATH }}
146+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
147+
restore-keys: |
148+
${{ runner.os }}-pnpm-store-
149+
150+
- name: Cache Vite build
151+
uses: actions/cache@v4
152+
with:
153+
path: |
154+
node_modules/.vite
155+
key: ${{ runner.os }}-vite-${{ hashFiles('pnpm-lock.yaml') }}-${{ hashFiles('**/*.ts', '**/*.vue') }}
156+
restore-keys: |
157+
${{ runner.os }}-vite-${{ hashFiles('pnpm-lock.yaml') }}-
158+
159+
- name: Install dependencies
160+
run: pnpm install --frozen-lockfile
161+
162+
- name: Build application
163+
run: pnpm build
164+
165+
- name: Upload build artifacts
166+
uses: actions/upload-artifact@v4
167+
with:
168+
name: build-output
169+
path: dist/
170+
retention-days: 7
171+
172+
# ============================================================================
173+
# 依赖安全审计
174+
# ============================================================================
175+
security:
176+
name: Security Audit
177+
runs-on: ubuntu-latest
178+
steps:
179+
- name: Checkout repository
180+
uses: actions/checkout@v4
181+
182+
- name: Setup pnpm
183+
uses: pnpm/action-setup@v4
184+
with:
185+
version: ${{ env.PNPM_VERSION }}
186+
run_install: false
187+
188+
- name: Setup Node.js
189+
uses: actions/setup-node@v4
190+
with:
191+
node-version: ${{ env.NODE_VERSION }}
192+
cache: "pnpm"
193+
194+
- name: Install dependencies
195+
run: pnpm install --frozen-lockfile
196+
197+
- name: Run security audit
198+
run: pnpm audit --audit-level=high
199+
continue-on-error: true
200+
201+
# ============================================================================
202+
# 依赖更新检查(仅 PR)
203+
# ============================================================================
204+
dependency-review:
205+
name: Dependency Review
206+
runs-on: ubuntu-latest
207+
if: github.event_name == 'pull_request'
208+
steps:
209+
- name: Checkout repository
210+
uses: actions/checkout@v4
211+
212+
- name: Dependency Review
213+
uses: actions/dependency-review-action@v4
214+
with:
215+
fail-on-severity: high
216+
allow-licenses: MIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, 0BSD

0 commit comments

Comments
 (0)