From 654106f8991aab85da715845952d2cea3885e786 Mon Sep 17 00:00:00 2001 From: RockChinQ <1010553892@qq.com> Date: Tue, 30 Jul 2024 17:30:00 +0800 Subject: [PATCH] =?UTF-8?q?doc:=20=E6=B7=BB=E5=8A=A0=20=E5=BC=80=E5=8F=91?= =?UTF-8?q?=20=E7=AB=A0=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/docs/.vitepress/config.mts | 3 ++- docs/docs/develop/bot.md | 11 +++++++++ docs/docs/develop/campux.md | 42 ++++++++++++++++++++++++++++++--- 3 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 docs/docs/develop/bot.md diff --git a/docs/docs/.vitepress/config.mts b/docs/docs/.vitepress/config.mts index a01a3db..5c09197 100644 --- a/docs/docs/.vitepress/config.mts +++ b/docs/docs/.vitepress/config.mts @@ -44,7 +44,8 @@ export default defineConfig({ { text: '开发', items: [ - { text: 'Campux 前后端', link: '/develop/campux' } + { text: 'Campux 前后端', link: '/develop/campux' }, + { text: 'CampuxBot', link: '/develop/bot' } ] } ], diff --git a/docs/docs/develop/bot.md b/docs/docs/develop/bot.md new file mode 100644 index 0000000..2151fda --- /dev/null +++ b/docs/docs/develop/bot.md @@ -0,0 +1,11 @@ +# CampuxBot + +> 代码仓库:https://github.com/idoknow/CampuxBot + +CampuxBot 的 QQ 机器人模块基于[NoneBot2](https://nonebot.dev/)构建。 + +启动机器人: + +```bash +python main.go +``` \ No newline at end of file diff --git a/docs/docs/develop/campux.md b/docs/docs/develop/campux.md index 54993a5..0b89625 100644 --- a/docs/docs/develop/campux.md +++ b/docs/docs/develop/campux.md @@ -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/`目录下对应文件。