cy check
This commit is contained in:
parent
334639a6c0
commit
23d38c406f
@ -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,25 +135,13 @@ 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);
|
||||
$cy = Api::urlGet($url);
|
||||
if($cy->code != 0){
|
||||
$cylevel = $cy->level;
|
||||
return $cylevel;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user