网易接口失效, 换ip138 根据不同地区用户跳转分站 怎么修改
环境 CentOS 7
要求 完整代码 不需要其他特殊配置
<!DOCTYPEhtml>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>加载中...</title>
<meta name="keywords"content=""/>
<meta name="description"content=""/>
<script src="http://ip.ws.126.net/ipquery"></script>
<script type="text/javascript">
// <!-- 情况一限定地区跳转 -->
if(lc=="北京市" || lc=="上海市")
{document.location.href="http://so.com";}
// <!-- 情况二限定地区跳转 -->
else if(lc=="广州市" || lc=="梅州市")
{document.location.href="http://baidu.com";}
// <!-- 非上述地区 -->
else
{document.location.href="http://sohu.com";}
</script>
</body>
网易接口失效,换ip138
ip138 api 接口
https://api.ip138.com/ip/?ip=&datatype=jsonp&token=key
测试接口获取 https://docs.qq.com/doc/DZXFIbmxmWGNYcXZF
返回数据
{"ret":"ok","ip":"123.123.123.123","data":["中国","河南","郑州","二七区","联通","460000","0371"]}
ip138 api文档 https://user.ip138.com/ip/doc