startLocalServiceDiscovery在微信7.0.18上运行失败
发布于 5 年前 作者 oli 4807 次浏览 来自 问答

今天升级了一下微信到7.0.18,以前运行OK的代码出问题了,就如下简单的代码,在开发工具上会到success里面,但在真机上就会到fail里面去。而且微信没有升级到7.0.18之前都运行的好好的。郁闷。错误信息就是:startLocalServiceDiscovery:fail search error

wx.startLocalServiceDiscovery({

      serviceType: '_http._tcp.',

      success: function(res){

        let items = that.data.items;

        items.push('success');

        items.push(res.errMsg)

        that.setData({items: items})

      },

      fail:function(res){

        let items = that.data.items;

        items.push('fail');

        items.push(res.errMsg)

        that.setData({items: items})

      },

      complete:function(res){

        let items = that.data.items;

        items.push('complete');

        items.push(res.errMsg)

        that.setData({items: items})

      },

    })

  },

1 回复

你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html,在手机微信那里上传下日志: 我->设置->帮助与反馈右上角有个上报日志的入口,麻烦提供一下微信号,时间点(具体到分钟)

回到顶部