diff --git a/packages/vue-cli-plugin-uni/lib/format-log.js b/packages/vue-cli-plugin-uni/lib/format-log.js index b34bf74c2fdc89af7b5e81eba81e6576ee7077c2..fb6017e8e945b8617b0dfa2ab4f55676cbc06466 100644 --- a/packages/vue-cli-plugin-uni/lib/format-log.js +++ b/packages/vue-cli-plugin-uni/lib/format-log.js @@ -19,9 +19,9 @@ export default function formatLog () { } var msgs = args.map(function (v) { - var type = Object.prototype.toString.call(v) + var type = Object.prototype.toString.call(v).toLowerCase() - if (type.toLowerCase() === '[object object]') { + if (type === '[object object]' || type === '[object array]') { try { v = '---BEGIN:JSON---' + JSON.stringify(v) + '---END:JSON---' } catch (e) {