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\facade\Config;
|
||||||
use think\exception\ValidateException;
|
use think\exception\ValidateException;
|
||||||
use taoler\com\Files;
|
use taoler\com\Files;
|
||||||
|
use taoler\com\Api;
|
||||||
|
|
||||||
class Set extends AdminController
|
class Set extends AdminController
|
||||||
{
|
{
|
||||||
@ -134,25 +135,13 @@ class Set extends AdminController
|
|||||||
public function check($url)
|
public function check($url)
|
||||||
{
|
{
|
||||||
$url = $url.'?u='.Request::domain();
|
$url = $url.'?u='.Request::domain();
|
||||||
$ch =curl_init ();
|
$cy = Api::urlGet($url);
|
||||||
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){
|
if($cy->code != 0){
|
||||||
$cylevel = $cy->level;
|
$cylevel = $cy->level;
|
||||||
return $cylevel;
|
return $cylevel;
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user