|
@@ -34,7 +34,7 @@ class Base extends Controller
|
|
|
|
|
|
$getip = getIp();//获取ip
|
|
|
// $getip = "218.70.26.255"; //重庆IP地址
|
|
|
- if($getip == ''||$getip=='127.0.0.1'){
|
|
|
+ if($getip == ''||$getip=='127.0.0.1'||$getip=='::1'){//nginx环境为本地ip为127.0.0.1,apache本地环境为::1
|
|
|
$getip="210.51.167.169";//默认为北京ip地址
|
|
|
}
|
|
|
$content = json_decode(file_get_contents("https://api.seniverse.com/v3/weather/now.json?key=S3OSd1xyPevThEbnB&location=$getip"),true);
|