很简单实用的ip地址接口, 只返回当前ip
接口返回内容格式为:
{“ip”:“27.211.239.98”}
// 获取IP地址
wx.request({
url: 'https://tianqiapi.com/ip/',
data: {
},
method: 'POST',
header: {
'content-type': 'application/x-www-form-urlencoded'
},
success: function (res) {
console.log('IP地址: ' + res.data.ip);
}
});
温馨提醒
如果是测试, 请勾选配置 不校验合法域名、web-view(业务域名)、TLS 版本以及 HTTPS 证书
如果正式使用, 请添加安全域名 ( tianqiapi.com )