Files
x_admin/docs/0.使用.md
2023-12-01 00:50:48 +08:00

48 lines
946 B
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.

# 前期准备
后端
1. 安装 go
2. 安装 mysql
3. 安装 redis
4. 安装 git
5. 安装 swag: `go install github.com/swaggo/swag/cmd/swag@latest`
前端
1. 安装 node
2. 安装 pnpm可选
3. 安装 git
# 使用
### 1.下载项目
```
git clone git@gitee.com:xiangheng/x_admin.git
```
### 2.创建数据库并导入`x_admin/sql/`目录下 sql 文件
### 3.运行后端
1. 复制并重命名`x_admin/server/.env.example``x_admin/server/.env`文件,
2. `.env`必须配置 `mysql``redis` 信息。
```bash
cd x_admin/server
# 生成接口文档
swag init
# 运行, 在vscode中打开server目录中的文件按F5即可运行
go run .
```
### 4.运行前端
1. 复制并重命名`x_admin/admin/.env.development.example``x_admin/admin/.env.development`文件,
2. `.env.development`必须配置 `VITE_APP_BASE_URL`后端地址信息。
```bash
cd x_admin/admin
# 安装依赖
pnpm install
# 运行
pnpm run dev
```