Skip to content

Commit

Permalink
doc: 添加 开发 章节
Browse files Browse the repository at this point in the history
  • Loading branch information
RockChinQ committed Jul 30, 2024
1 parent 505cd1d commit 654106f
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 4 deletions.
3 changes: 2 additions & 1 deletion docs/docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ export default defineConfig({
{
text: '开发',
items: [
{ text: 'Campux 前后端', link: '/develop/campux' }
{ text: 'Campux 前后端', link: '/develop/campux' },
{ text: 'CampuxBot', link: '/develop/bot' }
]
}
],
Expand Down
11 changes: 11 additions & 0 deletions docs/docs/develop/bot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# CampuxBot

> 代码仓库:https://github.com/idoknow/CampuxBot
CampuxBot 的 QQ 机器人模块基于[NoneBot2](https://nonebot.dev/)构建。

启动机器人:

```bash
python main.go
```
42 changes: 39 additions & 3 deletions docs/docs/develop/campux.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,43 @@
# Campux 前后端

具体细节请见[Campux仓库](https://github.com/idoknow/Campux)
## 资源

## 接口文档
- 代码仓库:https://github.com/idoknow/Campux
- 接口文档:https://apifox.com/apidoc/shared-463342af-a8a6-4839-b175-9042d59dd6d1

https://apifox.com/apidoc/shared-463342af-a8a6-4839-b175-9042d59dd6d1

## 后端

代码位于 `backend` 目录下,启动文件为根目录`main.go`

```bash
go run main.go
```

## 前端

位于 `frontend` 目录下。


```bash
#安装依赖
npm install
```

需要先部署一个测试后端,然后修改 `frontend/src/store/index.js` 中的 `base_url` 为测试后端地址。
这种模式下,启动的前端和后端不在同一个域,但后端在调试模式下允许跨域,故可以正常使用接口。
但 Cookies 不能正常被前端 JS 修改,故无法进行退出操作。


```bash
# 启动前端调试
npm run dev
```

如果需要嵌入到后端,需要先构建前端代码:

```bash
npm run build
```

此时启动后端,访问非`/v1`开头的路径,后端将发送`frontend/dist/`目录下对应文件。

0 comments on commit 654106f

Please sign in to comment.