This commit is contained in:
toogee 2020-05-22 21:10:01 +08:00
parent 334639a6c0
commit 23d38c406f

View File

@ -10,6 +10,7 @@ use app\admin\model\MailServer;
use think\facade\Config;
use think\exception\ValidateException;
use taoler\com\Files;
use taoler\com\Api;
class Set extends AdminController
{
@ -134,24 +135,12 @@ class Set extends AdminController
public function check($url)
{
$url = $url.'?u='.Request::domain();
$ch =curl_init ();
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT, 20);
curl_setopt($ch,CURLOPT_POST, 1);
$data = curl_exec($ch);
$httpCode = curl_getinfo($ch,CURLINFO_HTTP_CODE);
curl_close($ch);
if($httpCode == '200'){
$cy = json_decode($data);
if($cy->code != 0){
$cylevel = $cy->level;
return $cylevel;
} else {
return 0;
}
$cy = Api::urlGet($url);
if($cy->code != 0){
$cylevel = $cy->level;
return $cylevel;
} else {
return 0;
return 0;
}
}