From 0634cadcedb3b3a6f5730390fdf62a7e5cb617c2 Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 2 Jul 2026 20:45:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=AE=A1=E7=90=86=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 + README.md | 17 ++++ frontend/src/App.vue | 23 ++++- frontend/src/router/index.ts | 27 +++++- frontend/src/stores/auth.ts | 63 ++++++++++++++ frontend/src/views/AdminView.vue | 67 +++++++++++++++ frontend/src/views/LoginView.vue | 141 ++++++++++++++++++++++++++++++ go.mod | 1 + go.sum | 2 + internal/handler/auth.go | 79 +++++++++++++++++ internal/middleware/auth.go | 82 ++++++++++++++++++ main.go | 10 +++ pytest/conftest.py | 34 ++++++++ pytest/pytest.ini | 3 + pytest/requirements.txt | 3 + pytest/websocket_test.py | 142 +++++++++++++++++++++++++++++++ 16 files changed, 689 insertions(+), 7 deletions(-) create mode 100644 README.md create mode 100644 frontend/src/stores/auth.ts create mode 100644 frontend/src/views/AdminView.vue create mode 100644 frontend/src/views/LoginView.vue create mode 100644 internal/handler/auth.go create mode 100644 internal/middleware/auth.go create mode 100644 pytest/conftest.py create mode 100644 pytest/pytest.ini create mode 100644 pytest/requirements.txt create mode 100644 pytest/websocket_test.py diff --git a/.gitignore b/.gitignore index 0a1cf2d..b30ca97 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ frontend/node_modules/ .env .env.local .env.*.local + +lmvpnweb.sock \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..a05badb --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +# lmvpn_server + +## 目录说明 + +- `data/` - 程序运行生成的数据(配置文件、数据库文件) +- `dist/` - 前端构建产物,由 Go 服务端托管提供静态资源 +- `frontend/` - 前端工程(Vue 3 + TypeScript + Vite) +- `internal/` - Go 后端源码 + - `config/` - 配置加载 + - `db/` - 数据库操作 + - `handler/` - HTTP 请求处理 + - `middleware/` - 中间件(认证等) + - `model/` - 数据模型 + - `vpn/` - VPN 相关逻辑(认证、隧道等) +- `pytest/` - Python 测试脚本 +- `main.go` - Go 服务端入口文件 +- `go.mod` / `go.sum` - Go 模块依赖管理 diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 7905b05..b2b7781 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,6 +1,14 @@