You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1.4 KiB
1.4 KiB
快速安装指南
前置要求
- Python 3.8+
- Node.js 16+
- MySQL 5.7+
步骤
1. 数据库设置
# 登录MySQL
mysql -u root -p
# 执行数据库创建脚本(您提供的SQL)
# 然后执行补充SQL
mysql -u root -p Simple_CA < database_supplement.sql
2. 后端设置
cd backend
# 创建虚拟环境(推荐)
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# 安装依赖
pip install -r requirements.txt
# 创建管理员账号
python init_admin.py
# 启动后端服务
python app.py
后端将在 http://localhost:5000 运行
3. 前端设置
cd frontend
# 安装依赖
npm install
# 启动开发服务器
npm run dev
前端将在 http://localhost:8080 运行
首次使用
- 访问
http://localhost:8080 - 使用管理员账号登录(通过
init_admin.py创建) - 普通用户可以注册新账号
常见问题
数据库连接失败
- 检查
backend/config.py中的数据库配置 - 确保MySQL服务已启动
- 检查用户名和密码是否正确
CA证书初始化失败
- 确保
backend/ca/目录有写权限 - 检查是否有足够的磁盘空间
前端无法连接后端
- 检查后端服务是否运行在 5000 端口
- 检查
frontend/vite.config.js中的代理配置