diff --git a/packages/uni-app-plus/dist/index.js b/packages/uni-app-plus/dist/index.js index b852d120c00caf44e8896da2c910f0343ba68871..7060d47f7509ce3ba26a9e80a75c3b9dbe00849e 100644 --- a/packages/uni-app-plus/dist/index.js +++ b/packages/uni-app-plus/dist/index.js @@ -345,6 +345,10 @@ function getData (vueOptions, context) { // 对 data 格式化 data = JSON.parse(JSON.stringify(data)); } catch (e) {} + } + + if (!isPlainObject(data)) { + data = {}; } Object.keys(methods).forEach(methodName => { diff --git a/packages/uni-app-plus/package.json b/packages/uni-app-plus/package.json index 9389486e0b2c2b8be9c3e4c1b5a98373f2305e66..2956a7d62a3f6f5f077d04d4a3e2b430bbed765b 100644 --- a/packages/uni-app-plus/package.json +++ b/packages/uni-app-plus/package.json @@ -1,6 +1,6 @@ { "name": "@dcloudio/uni-app-plus", - "version": "0.0.221", + "version": "0.0.222", "description": "uni-app app-plus", "main": "dist/index.js", "scripts": { diff --git a/packages/uni-mp-baidu/dist/index.js b/packages/uni-mp-baidu/dist/index.js index 297eae966cad8240b6d11586b066c1597490b267..003f332cd96a37588b16aefa7ad8ae32d6be5954 100644 --- a/packages/uni-mp-baidu/dist/index.js +++ b/packages/uni-mp-baidu/dist/index.js @@ -480,6 +480,10 @@ function getData (vueOptions, context) { // 对 data 格式化 data = JSON.parse(JSON.stringify(data)); } catch (e) {} + } + + if (!isPlainObject(data)) { + data = {}; } Object.keys(methods).forEach(methodName => { diff --git a/packages/uni-mp-baidu/package.json b/packages/uni-mp-baidu/package.json index ebc76570daf0b709a9e12dcb92e1726ef52f03f5..63f4cb6f8db6639ae93f18eed689127c3ef4acbe 100644 --- a/packages/uni-mp-baidu/package.json +++ b/packages/uni-mp-baidu/package.json @@ -1,6 +1,6 @@ { "name": "@dcloudio/uni-mp-baidu", - "version": "0.0.816", + "version": "0.0.817", "description": "uni-app mp-baidu", "main": "dist/index.js", "scripts": { diff --git a/packages/uni-mp-toutiao/dist/index.js b/packages/uni-mp-toutiao/dist/index.js index efe536a646248560cb9ba473f1785df065995e8e..9ce5941910f3fcec5cb80e88a21aee256cdffaf8 100644 --- a/packages/uni-mp-toutiao/dist/index.js +++ b/packages/uni-mp-toutiao/dist/index.js @@ -525,6 +525,10 @@ function getData (vueOptions, context) { // 对 data 格式化 data = JSON.parse(JSON.stringify(data)); } catch (e) {} + } + + if (!isPlainObject(data)) { + data = {}; } Object.keys(methods).forEach(methodName => { diff --git a/packages/uni-mp-toutiao/package.json b/packages/uni-mp-toutiao/package.json index ca50ee5473ba20aee04dd11505541555e5bff36e..ec08f6faaf6a3a8cd6ed8acd9b324163dd094688 100644 --- a/packages/uni-mp-toutiao/package.json +++ b/packages/uni-mp-toutiao/package.json @@ -1,6 +1,6 @@ { "name": "@dcloudio/uni-mp-toutiao", - "version": "0.0.316", + "version": "0.0.317", "description": "uni-app mp-toutiao", "main": "dist/index.js", "scripts": { diff --git a/packages/uni-mp-weixin/dist/index.js b/packages/uni-mp-weixin/dist/index.js index b7d1642c2f3fad0a75ab51b6fc5f97698951ae35..938a0688c7beb976db80bc44088b5639a4e4a655 100644 --- a/packages/uni-mp-weixin/dist/index.js +++ b/packages/uni-mp-weixin/dist/index.js @@ -372,6 +372,10 @@ function getData (vueOptions, context) { // 对 data 格式化 data = JSON.parse(JSON.stringify(data)); } catch (e) {} + } + + if (!isPlainObject(data)) { + data = {}; } Object.keys(methods).forEach(methodName => { diff --git a/packages/uni-mp-weixin/package.json b/packages/uni-mp-weixin/package.json index 2bea7672557aba28ef886946ba4997d46c19379b..bc3caa4a94e9ca0898f6007bc820b46148b09c43 100644 --- a/packages/uni-mp-weixin/package.json +++ b/packages/uni-mp-weixin/package.json @@ -1,6 +1,6 @@ { "name": "@dcloudio/uni-mp-weixin", - "version": "0.0.940", + "version": "0.0.941", "description": "uni-app mp-weixin", "main": "dist/index.js", "scripts": { diff --git a/src/core/runtime/wrapper/util.js b/src/core/runtime/wrapper/util.js index e99d662586bec1a9ce0ffe6c1898a645a52ff893..08e2e9c627b9b989dac1666e89d5f445eb9e16cd 100644 --- a/src/core/runtime/wrapper/util.js +++ b/src/core/runtime/wrapper/util.js @@ -41,6 +41,10 @@ export function getData (vueOptions, context) { // 对 data 格式化 data = JSON.parse(JSON.stringify(data)) } catch (e) {} + } + + if (!isPlainObject(data)) { + data = {} } Object.keys(methods).forEach(methodName => {