增加微信通知功能

This commit is contained in:
2026-09-16 18:06:18 +08:00
parent b48688cbab
commit f386899625
23 changed files with 3539 additions and 18 deletions
+117
View File
@@ -0,0 +1,117 @@
import request from "@/utils/request";
/*************************************************
* 微信公众号(服务号):配置 / 绑定 / 粉丝 / 推送
*************************************************/
/** 获取服务号配置(敏感字段返回掩码) */
export function getWechatMpConfig() {
return request({
url: "/platform/wechatMp/config",
method: "get",
});
}
/** 保存服务号配置(掩码 / 空串表示不修改原值) */
export function saveWechatMpConfig(data) {
return request({
url: "/platform/wechatMp/config",
method: "post",
data,
});
}
/** 连接测试:校验 AppID / AppSecret 是否能换取 access_token */
export function testWechatMpConnection() {
return request({
url: "/platform/wechatMp/test",
method: "post",
});
}
/** 发起绑定:生成带参数二维码(扫码关注后公众号回复验证码) */
export function startWechatMpBind() {
return request({
url: "/platform/wechatMp/bind/start",
method: "post",
});
}
/** 查询绑定会话状态:0待扫码 1已扫码待核销 2已核销 3已过期 */
export function getWechatMpBindStatus(scene) {
return request({
url: "/platform/wechatMp/bind/status",
method: "get",
params: { scene },
});
}
/** 核销验证码完成绑定 */
export function confirmWechatMpBind(data) {
return request({
url: "/platform/wechatMp/bind/confirm",
method: "post",
data,
});
}
/** 当前平台用户的绑定信息 */
export function getMyWechatMpBinding() {
return request({
url: "/platform/wechatMp/my",
method: "get",
});
}
/** 解除当前平台用户的微信绑定 */
export function unbindWechatMp() {
return request({
url: "/platform/wechatMp/unbind",
method: "post",
});
}
/** 粉丝列表 */
export function getWechatMpFollowers(params) {
return request({
url: "/platform/wechatMp/followers",
method: "get",
params,
});
}
/** 设置粉丝备注 */
export function setWechatMpFollowerRemark(data) {
return request({
url: "/platform/wechatMp/follower/remark",
method: "post",
data,
});
}
/** 解除粉丝绑定(保留粉丝记录) */
export function unbindWechatMpFollower(data) {
return request({
url: "/platform/wechatMp/follower/unbind",
method: "post",
data,
});
}
/** 批量推送(认证后可用) */
export function pushWechatMpMessage(data) {
return request({
url: "/platform/wechatMp/push",
method: "post",
data,
});
}
/** 测试推送:发送给当前账号绑定的微信 */
export function pushWechatMpTest(data) {
return request({
url: "/platform/wechatMp/push/test",
method: "post",
data,
});
}