File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,13 @@ exports.createDeviceQRCode = function* (deviceIds) {
4242 return yield this . request ( url , postJSON ( info ) ) ;
4343} ;
4444
45- exports . authorizeDevices = function * ( devices , optype ) {
45+ /**
46+ * 设备授权接口
47+ * 详情请见:<http://iot.weixin.qq.com/wiki/new/index.html?page=3-4-5>
48+ * @param {Number } productID 产品编号
49+ * ```
50+ */
51+ exports . authorizeDevices = function * ( devices , optype , productID ) {
4652 var token = yield this . ensureAccessToken ( ) ;
4753 // https://api.weixin.qq.com/device/authorize_device?access_token=ACCESS_TOKEN
4854 var url = 'https://api.weixin.qq.com/device/authorize_device?access_token=' + token . accessToken ;
@@ -51,6 +57,9 @@ exports.authorizeDevices = function* (devices, optype) {
5157 'device_list' : devices ,
5258 'op_type' : optype
5359 } ;
60+ if ( productID ) {
61+ data . product_id = productID ;
62+ }
5463 return yield this . request ( url , postJSON ( data ) ) ;
5564} ;
5665
You can’t perform that action at this time.
0 commit comments