Files
web/README.md

65 lines
1.3 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.
# 多站点管理后台
前后端分离的多站点管理系统。
## 项目结构
```
yh_web/
├── admin/ # 管理后台前端 (Vue 3 + Element Plus) - 端口 3000
├── web/ # 前台页面 (Vue 3) - 端口 3001
├── server/ # 后端 API (Go + Gin) - 端口 8080
└── README.md
```
## 快速启动
### 1. 启动后端
```bash
cd server
go mod tidy
go run main.go
```
### 2. 启动管理后台
```bash
cd admin
npm install
npm run dev
```
### 3. 启动前台
```bash
cd web
npm install
npm run dev
```
## 访问地址
- 管理后台: http://localhost:3000
- 前台: http://localhost:3001
- API: http://localhost:8080
## 线上部署(项目根目录:~/project/yh_web
线上路径为 `yxd@server1:~/project/yh_web`(即 `/home/yxd/project/yh_web`)。
首次或克隆后需加执行权限:
```bash
chmod +x pull-and-restart.sh restart.sh
```
若执行脚本报错 `bash\r: No such file or directory`(行尾为 Windows 的 CRLF在项目根目录执行一次
```bash
sed -i 's/\r$//' pull-and-restart.sh restart.sh
```
再执行 `chmod +x pull-and-restart.sh restart.sh` 后重试。
- **拉取代码并重启**`cd ~/project/yh_web && ./pull-and-restart.sh`
- **仅重启服务**`cd ~/project/yh_web && ./restart.sh`
- 对外域名https://yuheng.yuxindazhineng.com