官网前台 App-API
基础路径:
/app-api/website认证:除用户中心外,其他接口均为公开接口
统一响应格式 CommonResult<T>,前端 useApi 自动解包返回 data 字段。
1. 首页模块
GET /home/data
获取首页聚合数据(无需参数)。
响应:AppHomeDataRespVO
| 字段 | 类型 | 说 明 |
|---|---|---|
| stats | List<StatItem> | 统计数字(label, value, icon, numericVal, suffix) |
| solutions | List<SolutionItem> | 推荐方案(前6个) |
| products | List<SolutionItem> | 核心产品(前4个) |
| partners | Object | 合作伙伴(JSON) |
| banners | Object | 轮播图(JSON) |
| hero | Object | Hero配置(JSON) |
| advantages | Object | 核心优势(JSON) |
| cta | Object | CTA配置(JSON) |
前端引用:pages/index.vue
2. 产品中心模块
GET /product/list
产品列表。参数:categoryId(分类筛选)。
响应:List<AppProductListRespVO>(id, title, subtitle, thumbnail, categoryId, categoryName, description, tags, demoUrl, sortOrder)
GET /product/{id}
产品详情。路径参数:id。
响应:AppProductDetailRespVO(id, title, subtitle, thumbnail, description, detailContent, categoryId, categoryName, gallery(Object), tags, techTags, stats, pricingPlans, features, techStack, changelog, envRequirements, seoTitle, seoDescription, demoUrl, createTime)
GET /product/{id}/reviews
产品评价(分页)。参数:pageNo, pageSize。响应:PageResult<AppProductReviewRespVO>
GET /product/{id}/related
相关产品。响应:List<AppProductListRespVO>
3. 解决方案模块
GET /solution/list
方案列表。参数:categoryId, deployType, keyword。
响应:List<AppSolutionListRespVO>(id, title, subtitle, thumbnail, description, categoryId, categoryName, deployType, isHot, version, tags, demoUrl, sortOrder)
GET /solution/{id}
方案详情。路径参数:id。
GET /solution/{id}/related
相关方案。
GET /solution/categories
分类树。响应:List<IndustryCategoryRespVO>(树形,含 children 嵌套)
| 字段 | 说明 |
|---|---|
| id | 分类编号 |
| parentId | 父级编号 |
| name | 分类名称 |
| level | 层级 |
| sortOrder | 排序 |
| icon | 图标 |
| description | 描述 |
| status | 0正常 1停用 |
| children | 子分类列表 |
4. 源码下载模块
GET /source/list
源码包列表。响应:List<AppSourceListRespVO>
| 字段 | 说明 |
|---|---|
| id, name, version, icon | 基本信息 |
| description | 描述 |
| envTags | 环境标签列表 |
| updateTime | 更新时间 |
| fileSize | 大小(字节) |
| downloadCount | 下载次数 |
| categoryId, categoryName | 分类 |
GET /source/{id}
源码包详情。增加字段:changelog(JSON), envRequirements(JSON)。
GET /source/{id}/download
获取下载链接。返回纯字符串(预签名 URL,有效期5分钟)。
前端
useApi解包后直接得到 URL 字符串,使用window.open(url)或<a>标签下载。
5. 关于我们模块
GET /about/company
公司信息。响应:AppAboutCompanyRespVO(id, hero, advantages, timeline, partners)
GET /about/contact
联系方式。响应:AppAboutContactRespVO(companyName, slogan, address, phone, email, workingHours, mapLat, mapLng, qrCodeUrl)
GET /about/team
团队成员。响应:List<AppTeamMemberRespVO>(id, name, title, avatar, description, sort)
POST /about/message
提交留言。请求体:name, email, subject, message。返回:Boolean
6. 演示环境模块
GET /demo/list
演示环境列表。响应:List<DemoEnvironmentRespVO>
| 字段 | 说明 |
|---|---|
| id, productId | 编号 |
| name | 环境名称 |
| demoUrl, adminUrl | 地址 |
| username, password | 账号密码 |
| description | 描述 |
| status | 状态 |
| sortOrder | 排序 |
| screenshot | 截图 URL |
| accounts | 账号数组[{label, value}] |
| createTime | 创建时间 |
当 accounts JSON 为空时,后端自动从 username/password/demoUrl/adminUrl 构建 accounts 数组。
7. 授权查询模块
GET /license/verify
授权验证。参数(二选一):domainName、authorizationNo。
响应:Map<String, Object>(exists, domainName, authorizationNo, companyName, expirationTime, message)
返回动态 Map 而非固定 VO,前端通过
exists判断授权有效性。
8. 微信认证模块
GET /auth/qrcode
获取登录二维码。参数:redirectUri。响应:sessionId, qrcodeUrl
GET /auth/check
轮询 扫码状态。参数:sessionId。响应:
| 字段 | 说明 |
|---|---|
| status | 0=等待 1=已扫码 2=已确认 3=已过期 |
| accessToken | 登录成功返回 |
| refreshToken | 登录成功返回 |
| expiresIn | 过期时间(秒) |
GET /auth/callback
微信回调(由微信服务器调用,非前端直接调用)。参数:code, state
9. 用户中心模块
以下接口需在请求头携带有效
Authorization: Bearer {token}。
GET /user/profile
用户资料。响应:id, nickname, avatar, mobile, level, companyName
GET /user/licenses
我的授权。响应:List<AppUserLicenseRespVO>(id, authorizationNo, productId, productName, domainName, companyName, status, authorizeTime, expirationTime)
GET /user/downloads
下载记录(分页)。参数:pageNo, pageSize。响应:PageResult<AppDownloadLogRespVO>
10. 站点配置模块
GET /config/site-info
站点公开配置。响应:AppSiteInfoRespVO
| 字段 | 说明 |
|---|---|
| logo | Logo URL |
| companyName | 公司名称 |
| phone | 联系电话 |
| 联系邮箱 | |
| address | 地址 |
| icp | ICP备案号 |
| policeIcp | 公安备案号 |
| wxQrcode | 公众号二维码 |
| serviceQrcode | 客服微信二维码 |
| socialLinks | 社交媒体链接(JSON) |
11. 政策文档模块
GET /policy/get-by-type
获取政策文档。参数:policyType(privacy / terms)。响应:id, policyType, title, version, content, effectiveDate
12. 数据采集模块
由
plugins/analytics.client.ts自动调用。
POST /analytics/collect
批量事件采集。请求体:{ events: EventItem[] }
EventItem:type(pv/event), visitorId, sessionId, pagePath, pageTitle, eventType(click/submit/download/demo_try), eventTarget, eventLabel, metadata, referrer, utmSource, utmMedium, deviceType
POST /analytics/heartbeat
心跳上报。请求体:visitorId, sessionId, pagePath, duration
POST /analytics/path
访问路径上报。请求体:visitorId, userId, sessionId, pathSequence, entryPage, exitPage, totalPages, totalDuration, converted, conversionType