Files
JGE-RS-SL-WEB/README.md

131 lines
2.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 梦幻西游一站式运营管理平台
## 项目结构
```
JGE-RS-SL-WEB/
├── backend/ # NestJS后端
│ ├── src/
│ │ ├── auth/ # 后台认证模块
│ │ ├── player/ # 玩家服务模块
│ │ ├── common/ # 公共模块(过滤器、拦截器、管道)
│ │ ├── entities/ # 数据库实体
│ │ └── config/ # 配置文件
│ └── database/ # 数据库初始化脚本
└── frontend/ # React前端
├── src/
│ ├── pages/ # 页面组件
│ ├── components/ # 公共组件
│ ├── services/ # API服务
│ ├── stores/ # 状态管理
│ └── router/ # 路由配置
```
## 环境要求
- Node.js 22.x
- MySQL 8.4
- npm 10.x
## 快速开始
### 1. 数据库初始化
1. 创建数据库:
```sql
CREATE DATABASE jge_rs_sl_web DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
```
2. 导入初始化脚本:
```bash
mysql -u root -p jge_rs_sl_web < backend/database/init.sql
```
3. 默认管理员账号:
- 用户名admin
- 密码admin123
### 2. 后端启动
1. 配置环境变量:
编辑 `backend/.env` 文件,修改数据库连接信息:
```
DB_HOST=localhost
DB_PORT=3306
DB_USERNAME=root
DB_PASSWORD=your_password
DB_DATABASE=jge_rs_sl_web
JWT_SECRET=your_jwt_secret_key_change_in_production
JWT_EXPIRES_IN=24h
PORT=3000
NODE_ENV=development
```
2. 安装依赖并启动:
```bash
cd backend
npm install
npm run start:dev
```
后端服务将在 http://localhost:3000 启动
### 3. 前端启动
1. 安装依赖并启动:
```bash
cd frontend
npm install
npm run dev
```
前端服务将在 http://localhost:5173 启动
## 功能模块
### 玩家服务中心 (/player)
- 登录页面
- 控制台布局Header、Content、Footer
- 控制台主页
### 运营管理系统后台 (/admin)
- 登录页面JWT认证
- 后台布局Header、Sider、Content、Footer
- 工作台页面
## 技术栈
### 后端
- NestJS 11.x
- TypeORM
- MySQL 8.4
- JWT认证
- Passport
- Bcrypt密码加密
### 前端
- React 19.x
- TypeScript
- Vite
- Ant Design 6.1.2
- React Router
- Zustand状态管理
- Axios
## API接口
### 后台认证
- POST /admin/auth/login - 后台登录
- POST /admin/auth/logout - 后台登出
### 玩家认证
- POST /player/auth/login - 玩家登录
- POST /player/auth/logout - 玩家登出
## 开发说明
- 后端代码遵循NestJS最佳实践
- 前端代码严格遵循Ant Design官方标准
- JWT Token存储在内存中不使用localStorage/sessionStorage
- 所有API响应格式统一