upgrade/application/api/controller/Check.php

36 lines
742 B
PHP

<?php
namespace app\api\controller;
use app\common\controller\Api;
use think\Config;
/**
* 黑名单检测接口
*/
class Check extends Api
{
protected $noNeedLogin = ['*'];
protected $noNeedRight = ['*'];
/**
* 黑名单检测接口 true表示不在黑名单, false表示在黑名单
*/
public function index()
{
$sn = $this->request->get("sn", '');
$bool_rt = false;
if($sn != ''){
$redis = getRedis();
$key = "sn_black";
$rt = $redis->hget($key, $sn);
if($rt == '1'){
$bool_rt = false;
}else{
$bool_rt = true;
}
}
$this->success('success', $bool_rt);
}
}