Skip to content

Commit 98a2d26

Browse files
committed
修复:reportAnalytics 等方法多参数传递问题
1 parent 4386c5a commit 98a2d26

File tree

6 files changed

+14
-11
lines changed

6 files changed

+14
-11
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 0.1.2
2+
- 修复:`reportAnalytics` 等方法多参数传递问题
3+
14
## 0.1.1
25
- 优化
36

examples/alipay/js/mpapi.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/wechat/js/mpapi.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/mpapi.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mpapi",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "小程序API兼容插件,一次编写,多端运行。支持:微信小程序、支付宝小程序、百度智能小程序",
55
"main": "lib/mpapi.js",
66
"scripts": {

src/api.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ function _addMethod(methods){
2626

2727
if(typeof $global[attr] === 'function'){
2828

29-
this[attr] = (opts) => {
30-
let type = _toString.call(opts)
29+
this[attr] = (...opts) => {
30+
let type = _toString.call(opts[0])
3131

3232
if((type === '[object Undefined]' || type === '[object Object]')
3333
&& nocallback.indexOf(attr) === -1){
34-
return _Promised(attr, opts)
34+
return _Promised(attr, opts[0])
3535
}else{
36-
return $global[attr](opts)
36+
return $global[attr](...opts)
3737
}
3838
}
3939

0 commit comments

Comments
 (0)