转到文件
XuqmGroup eba5133fed fix: file upload 403 no longer clears token or triggers logout
403 from the file service (e.g. permissions/CORS error) was incorrectly
treated as an auth failure, removing the token and redirecting to login.
403 should only show an error message; only 401 indicates an auth failure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 13:31:11 +08:00
docs docs(deploy): 添加完整的部署文档和配置示例 2026-05-09 14:53:43 +08:00
docs-site docs: remove WebSocket doc, strip Update from server SDKs, add Harmony license 2026-05-16 11:56:40 +08:00
nginx feat: split web jenkins jobs 2026-05-09 16:22:13 +08:00
ops-platform feat: add app transfer, parallel upload toggle, webhook type config, fix Chinese encoding in JWT 2026-05-16 15:34:42 +08:00
tenant-platform fix: file upload 403 no longer clears token or triggers logout 2026-05-18 13:31:11 +08:00
.dockerignore feat(im): 添加平台事件通知功能支持应用审核状态实时更新 2026-05-08 18:32:46 +08:00
.gitignore chore: initial commit 2026-04-21 22:07:29 +08:00
.npmrc feat(im): 添加平台事件通知功能支持应用审核状态实时更新 2026-05-08 18:32:46 +08:00
.nvmrc docs(deploy): 添加部署文档和安全设计规范 2026-05-08 18:32:00 +08:00
Dockerfile docs(deploy): 添加部署文档和安全设计规范 2026-05-08 18:32:00 +08:00
Dockerfile.ops fix: add --platform=linux/amd64 to Dockerfiles for cross-platform build 2026-05-14 15:20:45 +08:00
Dockerfile.tenant fix: add --platform=linux/amd64 to Dockerfiles for cross-platform build 2026-05-14 15:20:45 +08:00
Jenkinsfile fix deploy: remove orphaned container before docker compose recreate 2026-05-17 12:35:05 +08:00
Jenkinsfile.ops-web feat: 授权管理页面+路由,IM状态30s轮询,移除接入文档,ops去除appKey/平台列,Jenkinsfile固定main分支 2026-05-16 11:31:21 +08:00
Jenkinsfile.tenant-web fix: remove orphaned container before docker compose recreate in correct Jenkinsfile 2026-05-17 12:44:14 +08:00
package-lock.json 一大波改动 2026-05-15 16:47:22 +08:00
package.json feat(tenant-platform): service activation realtime + store review retry 2026-05-16 14:27:02 +08:00
README.md docs(deploy): 添加完整的部署文档和配置示例 2026-05-09 14:53:43 +08:00
yarn.lock feat(tenant-platform): service activation realtime + store review retry 2026-05-16 14:27:02 +08:00

XuqmGroup Web 前端文档

当前推荐阅读入口:/docs/web/README.md
仓库内联调文档:docs/ACCESS.md
该文档保留为仓库内说明,线上访问地址、初始化管理员账号与最新前端联调信息请以最新文档为准。

Vue 3.5 · TypeScript · Vite 6 · Element Plus 2.9 · Pinia 3

工程结构

XuqmGroup-Web/
├── package.json            # Yarn Workspace 根配置
├── tenant-platform/        # 租户开放平台   :5173
└── ops-platform/           # 运营管理平台   :5174

启动

cd XuqmGroup-Web
yarn install

# 分别启动(两个终端)
yarn workspace tenant-platform dev
yarn workspace ops-platform dev

租户开放平台tenant-platform:5173

用户自助注册、管理应用、配置功能服务的对外平台。

路由结构

路径 组件 说明
/login LoginView 登录(图形验证码)
/register RegisterView 注册(邮箱验证码 60s 倒计时)
/forgot-password ForgotPasswordView 忘记密码
/dashboard DashboardView 控制台首页(需登录)
/apps AppListView 应用列表(需登录)
/apps/:id AppDetailView 应用详情(需登录)
/security SecurityCenterView 安全中心(需登录)
/docs DocsCenterView 接入文档(需登录)
/accounts SubAccountView 子账号管理(需登录)

认证流程

登录 → POST /api/auth/login → 获得 JWT
↓
Pinia authStore.setToken(jwt)
↓
localStorage 持久化
↓
axios 拦截器自动附加 Authorization: Bearer <jwt>
↓
401 响应 → 清除 Token → 跳转 /login

API 模块src/api/

文件 接口 说明
auth.ts authApi 验证码、注册、登录、找回密码
app.ts appApi 应用 CRUD
account.ts accountApi 子账号管理

Pinia Store

authStoresrc/stores/auth.ts

const auth = useAuthStore()

auth.token           // JWT 原始字符串
auth.payload.sub     // 租户 ID
auth.payload.username
auth.payload.nickname
auth.payload.type    // MAIN | SUB

auth.setToken(jwt)   // 登录后调用
auth.logout()        // 清除并跳转 /login

JWT Payload 由 atob(token.split('.')[1]) 解析,无需额外请求。

应用详情页AppDetailView

  • 平台 Tab 切换:ANDROID / IOS / HARMONY
  • 每个平台下显示 IM / 推送 / 版本管理 三个服务卡片
  • 支持一键开关服务、复制 secretKey、重新生成 secretKey

安全中心 / 接入文档

  • 安全中心提供 AppSecret 查看/重置入口,直接复用邮箱验证码流程
  • 接入文档页提供 RN、Android / iOS 和服务端的最短接入示例

子账号管理SubAccountView

创建子账号两步流程

  1. 输入邮箱 → 发送验证码 → 验证通过Redis 标记 24h 有效)
  2. 填写账号信息 → 创建子账号

运营管理平台ops-platform:5174

内部使用,管理所有租户、查看统计数据。独立账号体系。

生产环境独立域名:https://ops.xuqinmin.com/

路由结构

路径 组件 说明
/login LoginView 运营管理员登录
/tenants TenantListView 租户列表(搜索/分页/启用禁用)
/tenants/:id TenantDetailView 租户详情
/apps AppListView 应用列表
/apps/:id AppDetailView 应用详情
/statistics StatisticsView 服务运营总览
/service-requests ServiceRequestsView 服务开通审核
/operation-logs OperationLogView 操作日志

认证

localStorage 存储 ops_token(与租户平台 token 隔离)。
API 请求通过 src/api/client.ts 中的 axios 实例统一附加,401 跳回 /login

租户管理功能

  • 关键词搜索(用户名/邮箱)
  • 分页展示(每页 20 条)
  • 类型标签:主账号(蓝色)/ 子账号(灰色)
  • 状态标签:正常(绿色)/ 禁用(红色)
  • 一键启用/禁用

统计卡片

指标 接口字段
总租户数 totalTenants
今日新增 todayNew
活跃应用 activeApps
在线用户 onlineUsers

环境变量

在各平台根目录创建 .env.local

# tenant-platform
VITE_API_BASE_URL=https://dev.xuqinmin.com/api

# ops-platform
VITE_API_BASE_URL=https://ops.xuqinmin.com/api

未设置时默认代理到 http://localhost:8081Vite dev server proxy

构建部署

# 构建
yarn workspace tenant-platform build
yarn workspace ops-platform build

# 产物在各平台的 dist/ 目录,部署至 Nginx 或 CDN

Nginx 配置示例SPA history 模式):

location / {
    try_files $uri $uri/ /index.html;
}

location /api/ {
    proxy_pass http://127.0.0.1:8081/api/;
}