开发者工具模拟 wx.chooseImage js报错
发布于 5 年前 作者 leiyuan 4983 次浏览 来自 问答

(没有公众号网页开发这个类型吗?)

wx.chooseImage({
        count: 1, // 默认9
        sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
        sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
        success: function (res) {
            console.log(res);
        }
    });

SyntaxError: Unexpected token w in JSON at position 0

    at JSON.parse (<anonymous>)

    at Object.e._complete (jweixin-1.3.0.js:1)

    at c (jweixin-1.3.0.js:1)

    at Object.cb (jweixin-1.3.0.js:1)

    at d.registerCallback (<anonymous>:1:7386)

    at m.forEach (<anonymous>:1:850)

    at Array.forEach (<anonymous>)

    at d (<anonymous>:1:830)

    at WebSocket.j.onmessage (<anonymous>:1:723)

我把开发者工具装回 v0.22.203100 没有以上报错。

1 回复

Fri Jun 29 2018 21:38:19 GMT+0800 (CST) wx.chooseImage begin

VM74995:1 {scene: “1|2”, count: 1, sizeType: Array(1), sourceType: Array(2)}count: 1scene: "1|2"sizeType: [“compressed”]sourceType: (2) [“album”, “camera”]__proto__: Object

VM74995:1 Fri Jun 29 2018 21:38:19 GMT+0800 (CST) wx.chooseImage end

VM74995:1 {errMsg: “chooseImage:ok”, localIds: Array(2)}errMsg: "chooseImage:ok"localIds: (2) [“wxLocalResource://imageid123456789987654321”, “wxLocalResource://imageid987654321123456789”]__proto__: Object

VM74995:1 SyntaxError: Unexpected token w in JSON at position 0

    at JSON.parse (<anonymous>)

    at Object.e._complete (index.js:361)

    at c (index.js:37)

    at Object.eval [as cb] (index.js:6)

    at d.registerCallback (<anonymous>:1:6929)

    at m.forEach (<anonymous>:1:850)

    at Array.forEach (<anonymous>)

    at d (<anonymous>:1:830)

    at WebSocket.j.onmessage (<anonymous>:1:723)

console.error @ VM74995:1

m.forEach @ VM74995:1

d @ VM74995:1

j.onmessage @ VM74995:1

回到顶部