AI助手支持GPT4.0
使用wx.getLocalIPAddress 获取手机本地IP地址,预览正常真机调试出错?Use wx.getLocalIPAddress to get the local IP address of the mobile phone and preview the normal real device debugging error?
使用wx.getLocalIPAddress 获取手机本地IP地址,预览正常真机调试出错?
var app = getApp()
Page({
data: {
localIP: '' // IP地址
},
onLoad: function (e) { // 获取参数
var that = this;
wx.getLocalIPAddress({
success (res) {
//const localip = res.localip;
that.setData({
localIP: res.localip
})
}
})
}
})
“预览”显示192.168.1.3 很正常 。但是真机调试时,错误一大堆,哪个大侠帮忙分析一下。谢谢!
Var app = getapp () page ({data: {localip: '' / / IP address}, onload: function (E) {/ / get the parameter var that = this; Wx. Getlocalipaddress ({success (RES) {/ / const localip = res.localip; that. SetData ({localip: res.localip})})}) "Preview" displays 192.168.1.3, which is normal. But when debugging the real machine, there are a lot of errors. Which great Xia can help analyze it. thank you!
你好 手机对应一下微信版本哈