Anyon e634118a22 refactor(plugin): 迁移 v8 插件化组件体系
将 v6 中直接放在本地 app 的后台与微信能力迁移为 v8 插件组件,并把运行时基础能力沉淀到独立插件包。

主要内容:

- 新增 think-library、system、worker、static、install 等基础插件包。

- 新增 account、payment、wechat-client、wechat-service、wemall、wuma 等业务插件包。

- 移除 v6 的 app/admin 与 app/wechat 本地应用实现,改由插件分发接管。

- 将 Helper 能力彻底并入 System,统一为 plugin\system\helper\* 命名空间。

- 同步插件迁移发布清单与根 route 占位,保证安装发布流程可复现。
2026-05-08 15:30:46 +08:00

12 KiB
Raw Blame History

分销商城接口

接口标准

  • HTTP 入口:/api/wemall/{controller}/{action}
  • 公开接口:goods/*data/*help/*
  • 授权接口:/api/wemall/auth/*,需要 Authorization: Bearer <JWT>
  • 返回格式为 JSON
  • HTTP 状态码固定返回 200
  • code 统一使用常见业务状态语义:200 成功、401 未认证/登录过期、403 已认证但无权限、404 资源不存在、500 服务端异常
{
  "code": 200, // 业务状态码
  "info": "ok", // 提示信息
  "data": {}, // 业务数据
  "error": "", // 可选401/403 等鉴权异常时返回稳定错误标识
  "token": "jwt" // 续签时可能返回,可选
}

公开接口

/api/wemall/goods/get

  • 说明:获取商品列表或商品详情
{
  "code": "", // 可选,商品编码;传值时返回单个商品详情
  "coupon": "", // 可选,优惠券编码,用于按券过滤商品
  "keys": "", // 可选,商品名称关键字
  "vmarks": "", // 可选,多标签过滤值,多个标签用逗号分隔
  "cates": "", // 可选,分类编号
  "sort": 0, // 可选排序字段0 默认、1 热度、2 价格
  "order": 0, // 可选排序方向0 倒序、1 正序
  "page": 1, // 可选,页码
  "limit": 20 // 可选,分页条数,最大 60
}

/api/wemall/goods/cate

  • 说明:获取商品分类树和标签
{}

/api/wemall/goods/comments

  • 说明:分页获取商品评论
{
  "gcode": "", // 商品编码
  "page": 1 // 页码
}

/api/wemall/goods/region

  • 说明:获取物流配送区域
{}

/api/wemall/goods/express

  • 说明:获取可用快递公司
{}

/api/wemall/goods/hotkeys

  • 说明:获取搜索热词
{}

/api/wemall/data/get

  • 说明:读取指定页面或配置数据
{
  "name": "about" // 数据名称,如 `about`、`slider`、`agreement`
}

/api/wemall/data/spread

  • 说明:识别推荐人信息
{
  "from": 1 // 推荐人用户 ID
}

/api/wemall/data/layout

  • 说明:获取商城布局配置
{}

/api/wemall/data/slider

  • 说明:获取图片内容数据
{
  "keys": "首页图片" // 图片分组键名
}

/api/wemall/data/agreement

  • 说明:获取隐私协议和用户协议
{}

/api/wemall/help/problem/get

  • 说明:获取常见问题列表
{
  "id": 0, // 可选,问题 ID
  "page": 1 // 可选,页码
}

/api/wemall/help/feedback/get

  • 说明:获取反馈记录
{
  "id": 0, // 可选,反馈 ID
  "page": 1 // 可选,页码
}

/api/wemall/help/feedback/set

  • 说明:提交反馈意见
{
  "phone": "13800000000", // 联系手机号
  "content": "问题描述", // 反馈内容
  "images": "url1|url2" // 可选,反馈图片,多个地址用 `|` 分隔
}

/api/wemall/help/question/get

  • 说明:获取工单列表或工单详情
{
  "id": 0, // 可选,工单 ID传值时返回详情和回复
  "reply_st": 0, // 可选,回复状态筛选
  "name": "", // 可选,工单标题关键字
  "sort": "new", // 可选,排序方式:`new`、`hot`
  "page": 1 // 可选,页码
}

/api/wemall/help/question/set

  • 说明:提交工单
{
  "name": "订单问题", // 工单标题
  "phone": "13800000000", // 联系手机号
  "content": "问题描述", // 工单内容
  "images": "url1|url2" // 可选,附件图片,多个地址用 `|` 分隔
}

/api/wemall/help/question/reply

  • 说明:回复工单
{
  "ccid": 1, // 工单 ID
  "content": "补充说明", // 回复内容
  "images": "url1|url2" // 可选,回复图片
}

/api/wemall/help/question/confirm

  • 说明:确认工单已解决
{
  "ccid": 1 // 工单 ID
}

授权接口

/api/wemall/auth/cart/get

  • 说明:获取购物车数据
{
  "ghash": "" // 可选,商品规格哈希
}

/api/wemall/auth/cart/set

  • 说明:修改购物车商品数量
{
  "ghash": "SPEC_HASH", // 商品规格哈希
  "number": 1 // 购买数量
}

/api/wemall/auth/center/get

  • 说明:获取会员资料
{}

/api/wemall/auth/center/levels

  • 说明:获取会员等级列表
{}

/api/wemall/auth/center/discount

  • 说明:获取会员折扣信息
{}

/api/wemall/auth/checkin/add

  • 说明:执行签到
{}

/api/wemall/auth/checkin/get

  • 说明:获取签到记录
{
  "date": "2026-04" // 可选,年月筛选
}

/api/wemall/auth/checkin/config

  • 说明:获取签到配置
{}

/api/wemall/auth/coupon/get

  • 说明:分页获取卡券配置
{
  "type": "", // 可选,卡券类型
  "coid": 0, // 可选,卡券 ID
  "page": 1 // 页码
}

/api/wemall/auth/coupon/add

  • 说明:领取卡券
{
  "coid": 1 // 卡券配置 ID
}

/api/wemall/auth/coupon/mine

  • 说明:分页获取我的卡券
{
  "type": "", // 可选,卡券类型
  "coid": 0, // 可选,卡券 ID
  "status": "", // 可选,卡券状态
  "page": 1 // 页码
}

/api/wemall/auth/coupon/query

  • 说明:查询当前订单可用卡券
{
  "gcodes": "G001,G002", // 商品编码列表,多个编码用逗号分隔
  "amount": 0, // 订单金额
  "usable": 0, // 是否只返回当前用户可用卡券0 否1 是
  "level": "-", // 会员等级编码,默认 `-`
  "page": 1 // 页码
}

/api/wemall/auth/order/get

  • 说明:获取订单列表或订单详情
{
  "order_no": "", // 可选,订单号;传值时返回详情
  "status": "", // 可选,订单状态
  "page": 1 // 页码
}

/api/wemall/auth/order/add

  • 说明:创建订单
{
  "carts": "1,2,3", // 购物车 ID 列表
  "rules": "", // 直接下单时的规格规则串
  "agent": 0 // 代理升级标记或代理模式编号
}

/api/wemall/auth/order/express

  • 说明:模拟计算运费
{
  "order_no": "ORDER_NO", // 订单号
  "address_id": 1 // 收货地址 ID
}

/api/wemall/auth/order/perfect

  • 说明:确认收货地址
{
  "order_no": "ORDER_NO", // 订单号
  "address_id": 1 // 收货地址 ID
}

/api/wemall/auth/order/channel

  • 说明:获取可用支付通道
{}

/api/wemall/auth/order/payment

  • 说明:生成支付参数或执行余额/积分/优惠券抵扣
{
  "order_no": "ORDER_NO", // 订单号
  "channel_code": "wechat_jsapi", // 支付通道编码
  "balance": "0.00", // 可选,余额抵扣金额
  "integral": 0, // 可选,积分抵扣数量
  "coupon_code": "", // 可选,优惠券编码
  "order_ps": "", // 可选,订单备注
  "payment_back": "", // 可选,支付回跳地址
  "payment_image": "" // 可选,转账凭证图片
}

/api/wemall/auth/order/cancel

  • 说明:取消未支付订单
{
  "order_no": "ORDER_NO" // 订单号
}

/api/wemall/auth/order/remove

  • 说明:删除已取消订单
{
  "order_no": "ORDER_NO" // 订单号
}

/api/wemall/auth/order/confirm

  • 说明:确认收货
{
  "order_no": "ORDER_NO" // 订单号
}

/api/wemall/auth/order/comment

  • 说明:提交订单评论
{
  "order_no": "ORDER_NO", // 订单号
  "data": "{}" // 按商品规格哈希组织的评论 JSON包含评分、内容和图片
}

/api/wemall/auth/order/total

  • 说明:获取订单状态统计
{}

/api/wemall/auth/order/track

  • 说明:查询物流轨迹
{
  "code": "express_code", // 快递公司编码
  "number": "express_no" // 快递单号
}

/api/wemall/auth/rebate/get

  • 说明:分页获取返佣记录
{
  "type": "", // 可选,返佣类型
  "status": "", // 可选,返佣状态
  "page": 1 // 页码
}

/api/wemall/auth/rebate/prize

  • 说明:获取我的奖励汇总
{}

/api/wemall/auth/rebate/prizes

  • 说明:获取奖励明细
{}

/api/wemall/auth/refund/get

  • 说明:获取售后单列表
{
  "code": "", // 可选,售后单号
  "status": "", // 可选,售后状态
  "page": 1 // 页码
}

/api/wemall/auth/refund/add

  • 说明:创建售后单
{
  "order_no": "ORDER_NO", // 原订单号
  "type": 1, // 售后类型
  "amount": "0.00", // 退款金额
  "reason": "尺寸不合适", // 售后原因
  "phone": "13800000000", // 联系手机号
  "content": "", // 可选,补充说明
  "images": "url1|url2" // 可选,凭证图片
}

/api/wemall/auth/refund/express

  • 说明:填写退货物流
{
  "code": "REFUND_CODE", // 售后单号
  "express_code": "yto", // 快递公司编码
  "express_no": "YT123456789" // 快递单号
}

/api/wemall/auth/refund/cancel

  • 说明:取消售后单
{
  "code": "REFUND_CODE" // 售后单号
}

/api/wemall/auth/refund/confirm

  • 说明:确认售后完成
{
  "code": "REFUND_CODE" // 售后单号
}

/api/wemall/auth/refund/reasons

  • 说明:获取售后原因列表
{}

/api/wemall/auth/spread/get

  • 说明:分页获取我推广的用户
{
  "page": 1 // 页码
}

/api/wemall/auth/spread/bind

  • 说明:临时绑定推荐人
{
  "from": 1 // 推荐人用户 ID
}

/api/wemall/auth/spread/poster

  • 说明:获取推广海报
{}

/api/wemall/auth/transfer/add

  • 说明:提交提现申请
{
  "type": "alipay_account", // 提现方式
  "amount": "100.00", // 提现金额
  "remark": "用户提交提现申请!", // 可选,提现备注
  "alipay_user": "", // 支付宝开户姓名
  "alipay_code": "", // 支付宝收款账号
  "qrcode": "", // 二维码收款图
  "bank_wseq": "", // 银行联行号
  "bank_name": "", // 开户银行名称
  "bank_user": "", // 开户人姓名
  "bank_bran": "", // 开户支行
  "bank_code": "" // 银行卡号
}

/api/wemall/auth/transfer/get

  • 说明:分页获取提现记录
{
  "status": "", // 可选,提现状态
  "keys": "", // 可选,日期或单号关键字
  "page": 1 // 页码
}

/api/wemall/auth/transfer/cancel

  • 说明:取消提现申请
{
  "code": "TRANSFER_CODE" // 提现单号
}

/api/wemall/auth/transfer/confirm

  • 说明:确认提现到账
{
  "code": "TRANSFER_CODE" // 提现单号
}

/api/wemall/auth/transfer/config

  • 说明:获取提现配置
{}

/api/wemall/auth/action/collect/set

  • 说明:收藏商品
{
  "gcode": "G001" // 商品编码
}

/api/wemall/auth/action/collect/get

  • 说明:获取收藏列表
{
  "page": 1, // 页码
  "limit": 10 // 分页条数
}

/api/wemall/auth/action/collect/del

  • 说明:取消收藏
{
  "gcode": "G001" // 商品编码
}

/api/wemall/auth/action/collect/clear

  • 说明:清空收藏列表
{}

/api/wemall/auth/action/search/set

  • 说明:记录搜索关键字
{
  "keys": "羽绒服" // 搜索关键字
}

/api/wemall/auth/action/search/get

  • 说明:获取搜索记录
{
  "page": 1, // 页码
  "limit": 10 // 分页条数
}

/api/wemall/auth/action/history/set

  • 说明:记录商品浏览历史
{
  "gcode": "G001" // 商品编码
}

/api/wemall/auth/action/history/get

  • 说明:获取浏览历史
{
  "page": 1, // 页码
  "limit": 10 // 分页条数
}

/api/wemall/auth/action/history/del

  • 说明:删除单条浏览历史
{
  "gcode": "G001" // 商品编码
}

/api/wemall/auth/action/history/clear

  • 说明:清空浏览历史
{}