Files
campus-activity-system/README.md
2026-01-12 14:02:46 +08:00

124 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.
# 校园活动组织与报名系统
校园活动组织与报名系统,支持活动发布、报名、签到、评价等功能。
## 技术栈
### 后端
- Java 21
- Spring Boot 3.1.8
- Spring Security + JWT
- MyBatis-Plus
- MySQL
- Knife4j (API文档)
### 前端
- Vue 3 + TypeScript
- Vite
- Vant UI
- Pinia
- Vue Router
## 部署说明
### 1. 数据库配置
**数据库初始化脚本位置:** `server/docs/init.sql`
**初始化步骤:**
```bash
# 登录MySQL
mysql -u root -p
# 执行初始化脚本
source C:\Users\shiro\Desktop\campus-activity-system\server\docs\init.sql
```
**数据库配置文件位置:** `server/src/main/resources/application.yml`
**需要修改的配置项:**
```yaml
spring:
datasource:
url: jdbc:mysql://localhost:3306/campus_activity?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai&useSSL=false&allowPublicKeyRetrieval=true
username: root
password: ${DB_PASSWORD:root} # 修改为你的数据库密码
```
**环境变量配置(可选):**
- `DB_PASSWORD`: 数据库密码默认root
- `JWT_SECRET`: JWT密钥默认campus-activity-system-secret-key-for-jwt-token-generation-2025
### 2. 后端部署
**修改API地址** 后端默认运行在 `http://localhost:8080`
**启动后端:**
```bash
cd server
mvn clean package
java -jar target/campus-activity-system-1.0.0.jar
```
**API文档地址** `http://localhost:8080/doc.html`
### 3. 前端部署
**API地址配置文件位置** `web/src/utils/request.ts`
**需要修改的配置项:**
```typescript
const service = axios.create({
baseURL: 'http://100.64.32.254:8080/api/v1', // 修改为后端API地址
timeout: 10000,
});
```
**启动前端:**
```bash
cd web
npm install
npm run dev
```
**构建生产版本:**
```bash
npm run build
```
**前端访问地址:** `http://localhost:3000`
### 4. 默认管理员账号
- 用户名:`admin`
- 密码:`admin123`
## 项目结构
```
campus-activity-system/
├── server/ # 后端项目
│ ├── docs/ # 文档(含数据库初始化脚本)
│ └── src/
│ └── main/
│ ├── java/ # Java源码
│ └── resources/ # 配置文件application.yml
└── web/ # 前端项目
└── src/
├── utils/ # 工具类request.ts包含API地址配置
└── ...
```
## 注意事项
1. 部署前请确保已安装:
- JDK 21+
- MySQL 8.0+
- Node.js 18+
- Maven 3.8+
2. 前端API地址必须与后端实际运行地址一致
3. 数据库密码建议使用环境变量配置,不要直接写在配置文件中
4. 生产环境部署时请修改JWT密钥为强密码