From bb2e5292ef7f71c03eeab3270251b0b6a2564d6d Mon Sep 17 00:00:00 2001 From: zhangzeshuan Date: Tue, 15 Oct 2019 16:08:29 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=8A=E6=8A=A5?= =?UTF-8?q?=E8=AE=A2=E9=98=85=E6=B6=88=E6=81=AF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/config.js | 1 + sdk-file/src/wechat/index.js | 2 ++ sdk-file/src/wechat/subscribeMessage.js | 13 +++++++++++++ 3 files changed, 16 insertions(+) create mode 100644 sdk-file/src/wechat/subscribeMessage.js diff --git a/core/config.js b/core/config.js index 847e252b..285813d7 100644 --- a/core/config.js +++ b/core/config.js @@ -71,6 +71,7 @@ const API = { AUTHENTICATE: '/hserve/v2.1/idp/wechat/authenticate/', USER_ASSOCIATE: '/hserve/v2.0/idp/wechat/user-associate/', TEMPLATE_MESSAGE: '/hserve/v2.0/template-message-ticket/', + SUBSCRIBE_MESSAGE: '/hserve/v2.2/subscription-message/relationship-report/', DECRYPT: '/hserve/v1/wechat/decrypt/', WXACODE: '/hserve/v1.4/miniappcode/', CENSOR_IMAGE: '/hserve/v1.7/censor-image/', diff --git a/sdk-file/src/wechat/index.js b/sdk-file/src/wechat/index.js index bed816e6..33033b40 100644 --- a/sdk-file/src/wechat/index.js +++ b/sdk-file/src/wechat/index.js @@ -4,6 +4,7 @@ const wechatAuth = require('./auth') const polyfill = require('./polyfill') const censor = require('./censor') const reportTemplateMsgAnalytics = require('./reportTemplateMsgAnalytics') +const subscribeMessage = require('./subscribeMessage') BaaS._config.VERSION = __VERSION_WECHAT__ @@ -12,6 +13,7 @@ BaaS.use(polyfill) BaaS.use(wechatAuth) BaaS.use(censor) BaaS.use(reportTemplateMsgAnalytics) +BaaS.use(subscribeMessage) BaaS.pay = require('./pay') BaaS.order = require('./order') BaaS.request = require('./request') diff --git a/sdk-file/src/wechat/subscribeMessage.js b/sdk-file/src/wechat/subscribeMessage.js new file mode 100644 index 00000000..8cb9f8e2 --- /dev/null +++ b/sdk-file/src/wechat/subscribeMessage.js @@ -0,0 +1,13 @@ +const BaaS = require('core-module/baas') + +const API = BaaS._config.API + +module.exports = function (BaaS) { + BaaS.subscribeMessage = (subscription) => { + return BaaS._baasRequest({ + url: API.WECHAT.SUBSCRIBE_MESSAGE, + method: 'POST', + data: subscription, + }) + } +} From 4748af97a39112a8ac60da7a8cb957a77555fe0c Mon Sep 17 00:00:00 2001 From: zhangzeshuan Date: Thu, 17 Oct 2019 11:09:10 +0800 Subject: [PATCH 2/2] modify changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1b98e6e..a3f5aad6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ ## Standby +- [A] 微信小程序 SDK 支持上报订阅消息订阅关系 - [A] QQ 小程序 SDK 添加内容安全检测接口 - [A] 百度小程序 SDK 支持百度模版消息 formId 上报 - [M] 数据表批量操作,enableTrigger 为 false 时,移除默认的 limit