local function sucHandler( response )
print(response)
local result = json.decode(response)
if result and result.countryCode == "CN" then
print('ip OK')
else
print('ip fail')
end
end
local function failHandler(event )
-- self:enterScene("LoadScene")
print('ip fail')
end
jw.HTTP.post('http://ip-api.com/json', nil, sucHandler, failHandler, 5)
-- jw.HTTP.post('http://pv.sohu.com/cityjson?ie=utf-8', nil, sucHandler, failHandler, 5)
两个网站其实都可以.我的目地其实很简单,就为了判断是不是美国登录,或者中国登录,如果是美国登录,可能为appstore那边检查.