很簡單實用的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 )