feat: 完成 opsx-licence 许可证管理平台全栈实现

基于 opsx-web-lite 框架(Go+Gin+Vue3+Element Plus)构建许可证管理服务器,
业务域参考 Licence 服务器 Web 版。

【后端 - 4层架构】
- 认证:单 Admin 表 + JWT(HS256)
- 核心授权域:Product / Customer / License / Activation
  · License 生成/验证/激活/机器绑定/心跳/续期/吊销
  · 客户端契约接口:/api/v1/license/{verify,activate,deactivate,heartbeat}
- 定价订单:Plan / Order / 支付网关配置
- 防重复购买:CustomerEntitlement + 幂等支付 webhook + 手动发放
- 分析审计:Dashboard 统计 / Analytics / AuditLog / Setting 管理

【前端】
- Dashboard(ECharts 图表)、产品、客户、License、计划、订单、权益、日志、设置
- 9 个完整 CRUD 业务页面 + 登录/布局

【部署】
- SQLite + 单二进制(//go:embed 嵌入前端)
- 开发:./run.sh start(前端5181/后端9001)
- 生产:./run.sh build && ./run.sh binary start
- 默认账号:admin/admin

Author: Logan.Li
This commit is contained in:
Logan.Li committed 2026-08-07 15:02:00 +08:00
commit 4ae318335c
88 files changed
+10562

No files matched your search

+47
View File
@@ -0,0 +1,47 @@
# opsx-licence - 环境变量配置模板
# 复制此文件为 .env 并根据需要修改
# ============================================
# 后端配置 (backend)
# ============================================
# 服务器端口
PORT=9001
# 运行模式: debug / release
GIN_MODE=debug
# JWT 密钥(生产环境必须修改!)
JWT_SECRET=your-super-secret-key-change-this-in-production
# 数据库配置
# 可选: sqlite / mysql / postgres
DB_DRIVER=sqlite
DB_NAME=db.sqlite3
# MySQL 配置(使用 mysql 时填写)
# DB_HOST=127.0.0.1
# DB_PORT=3306
# DB_USER=root
# DB_PASSWORD=your-password
# DB_NAME=opsx_licence
# PostgreSQL 配置(使用 postgres 时填写)
# DB_HOST=127.0.0.1
# DB_PORT=5432
# DB_USER=postgres
# DB_PASSWORD=your-password
# DB_NAME=opsx_licence
# CORS 配置(多个用逗号分隔)
# CORS_ORIGINS=http://localhost:5181,http://127.0.0.1:5181
# ============================================
# 前端配置 (frontend)
# ============================================
# 开发环境 API 地址
VITE_API_BASE_URL=http://localhost:9001/api
# 生产环境 API 地址(构建时注入)
# VITE_APP_BASE_API=/api