Skip to content

Commit

Permalink
Merge branch 'wechat-subscribe-message'
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzeshuan committed Oct 17, 2019
2 parents 63f78cc + 4748af9 commit 877398d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## Standby
- [A] 微信小程序 SDK 支持上报订阅消息订阅关系
- [A] QQ 小程序 SDK 添加内容安全检测接口
- [A] 百度小程序 SDK 支持百度模版消息 formId 上报
- [M] 数据表批量操作,enableTrigger 为 false 时,移除默认的 limit
Expand Down
1 change: 1 addition & 0 deletions core/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/',
Expand Down
2 changes: 2 additions & 0 deletions sdk-file/src/wechat/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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__

Expand All @@ -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')
Expand Down
13 changes: 13 additions & 0 deletions sdk-file/src/wechat/subscribeMessage.js
Original file line number Diff line number Diff line change
@@ -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,
})
}
}

0 comments on commit 877398d

Please sign in to comment.