wx.shareFileMessage调用出错?

发布于 6 年前作者 achang5521 次浏览最后编辑 6 年前来自 ask

出现错误:shareFileMessage:fail can only be invoked by user TAP gesture.

  var g = Date.parse(new Date()), a = wx.getFileSystemManager(), n = wx.env.USER_DATA_PATH + “/盘点_” + g + “.txt”;

          a.writeFile({

            filePath: n,

            data: e,

            //encoding: ‘binary’,

            success: function () {

                //console.log(“打开文档失败1”, n);

                wx.shareFileMessage({

                    filePath: n,

                    success() {},

                    fail: console.error,

                  })

            }

        });

1 回复
taolai
taolai1 楼4 年前

只能用户点击调用