小程序里面如何获取客户端ip
先找个API接口
ipD() { uni.request({ url: 'https://xxx.com', success: (res) => { this.ip = res.data.ip this.ipData(); } }) }, ipData() { const that = this; uni.request({ url: 'https://xxx.com/' + this.ip, success: (res) => { console.log(res) that.city = res.data.city; } }) },