1.8.0
This commit is contained in:
@@ -28,7 +28,7 @@ class App extends Plugin
|
||||
|
||||
try{
|
||||
if($type == 'wx'){
|
||||
$msg = $this->query_wx($link);
|
||||
$msg = $this->query_wx2($link);
|
||||
}else{
|
||||
$msg = $this->query_qq($link);
|
||||
}
|
||||
@@ -39,6 +39,21 @@ class App extends Plugin
|
||||
return msg('ok','success',$msg);
|
||||
}
|
||||
|
||||
public function queryqq(){
|
||||
$link = input('post.url', null, 'trim');
|
||||
$randstr = input('post.randstr', null, 'trim');
|
||||
$ticket = input('post.ticket', null, 'trim');
|
||||
if(!$link) return msg('error','no url');
|
||||
|
||||
try{
|
||||
$msg = $this->query_qq_new($link, $ticket, $randstr);
|
||||
}catch(Exception $e){
|
||||
return msg('error', $e->getMessage());
|
||||
}
|
||||
|
||||
return msg('ok','success',$msg);
|
||||
}
|
||||
|
||||
private function query_qq_old($link){
|
||||
$url = 'https://cgi.urlsec.qq.com/index.php?m=gwComplainMergeIntoWechat&a=checkBlackStatus&callback=url_query&url='.urlencode($link);
|
||||
$data=$this->guanjia_curl($url);
|
||||
@@ -97,7 +112,53 @@ class App extends Plugin
|
||||
}
|
||||
|
||||
}else{
|
||||
$msg['检测URL'] = $link;
|
||||
$msg['查询失败'] = $arr['data'];
|
||||
}
|
||||
|
||||
return $msg;
|
||||
}
|
||||
|
||||
private function query_qq_new($link, $ticket, $randstr){
|
||||
$url='https://cgi.urlsec.qq.com/index.php?m=check&a=gw_check&callback=url_query&url='.urlencode($link).'&ticket='.$ticket.'&randstr='.urlencode($randstr).'&_='.time().'123';
|
||||
$data=$this->guanjia_curl($url);
|
||||
$arr = jsonp_decode($data, true);
|
||||
if(!$arr) throw new Exception('查询接口返回数据解析失败');
|
||||
if(isset($arr['reCode']) && $arr['reCode']==0) {
|
||||
$arr = $arr['data']['results'];
|
||||
//print_r($arr);
|
||||
$msg['检测URL'] = $arr['url'];
|
||||
|
||||
if($arr['whitetype']==3||$arr['whitetype']==4){
|
||||
$msg['域名状态'] = '<font color="green">白名单</font>';
|
||||
}elseif($arr['whitetype']==2){
|
||||
$msg['域名状态'] = '<font color="red">已拦截</font>';
|
||||
$msg['拦截原因'] = $arr['WordingTitle'];
|
||||
$msg['拦截详情'] = $arr['Wording'];
|
||||
}elseif($arr['whitetype']==1){
|
||||
if($arr['eviltype']!=0){
|
||||
if($arr['eviltype']==2800 || $arr['eviltype']==2804)
|
||||
$msg['域名状态'] = '<font color="orange">QQ内拦截</font>';
|
||||
else
|
||||
$msg['域名状态'] = '<font color="orange">其他拦截('.$arr['eviltype'].')</font>';
|
||||
}else{
|
||||
$msg['域名状态'] = '<font color="green">未拦截</font><br/>';
|
||||
}
|
||||
$msg['安全联盟认证'] = ($arr['certify']==1?'是':'否');
|
||||
}
|
||||
if($arr['detect_time']!=0){
|
||||
$msg['记录时间'] = date("Y-m-d H:i:s", $arr['detect_time']);
|
||||
}
|
||||
if($arr['isDomainICPOk']==1){
|
||||
$msg['是否已备案'] = '是';
|
||||
$msg['备案主体'] = $arr['Orgnization'];
|
||||
$msg['备案号'] = $arr['ICPSerial'];
|
||||
}else{
|
||||
$msg['是否已备案'] = '否';
|
||||
}
|
||||
|
||||
}else{
|
||||
$msg['检测URL'] = $link;
|
||||
$msg['查询失败'] = $arr['data'];
|
||||
}
|
||||
|
||||
@@ -129,6 +190,20 @@ class App extends Plugin
|
||||
return $msg;
|
||||
}
|
||||
|
||||
private function query_wx2($link){
|
||||
$url = 'https://cgi.urlsec.qq.com/index.php?m=url&a=validUrl&url='.urlencode($link);
|
||||
$data = get_curl($url);
|
||||
$arr = json_decode($data, true);
|
||||
if(!$arr) throw new Exception('查询接口返回数据解析失败');
|
||||
$msg['检测URL'] = $link;
|
||||
if(isset($arr['data']) && $arr['data']=='ok'){
|
||||
$msg['微信拦截状态'] = '<font color="red">已拦截</font>';
|
||||
}else{
|
||||
$msg['微信拦截状态'] = '<font color="green">未拦截</font>';
|
||||
}
|
||||
return $msg;
|
||||
}
|
||||
|
||||
private function guanjia_curl($url)
|
||||
{
|
||||
$ch = curl_init();
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<button class="btn btn-dim btn-outline-info btn-block btn-lg card-link" @click="query('qq')" :disabled="query_disabled">
|
||||
<button class="btn btn-dim btn-outline-info btn-block btn-lg card-link" @click="queryqq()" :disabled="query_disabled">
|
||||
查询管家&QQ拦截
|
||||
</button>
|
||||
</div>
|
||||
@@ -44,6 +44,7 @@
|
||||
{block name="script"}
|
||||
<script src="{$cdn_cdnjs}vue/2.6.14/vue.min.js"></script>
|
||||
<script src="https://static.geetest.com/v4/gt4.js"></script>
|
||||
<script src="https://ssl.captcha.qq.com/TCaptcha.js"></script>
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#app',
|
||||
@@ -53,7 +54,8 @@ new Vue({
|
||||
type: '',
|
||||
showresult: false,
|
||||
result_info: [],
|
||||
captcha: null
|
||||
captcha: null,
|
||||
captcha1: null,
|
||||
},
|
||||
mounted() {
|
||||
this.$refs.input.focus();
|
||||
@@ -101,6 +103,36 @@ new Vue({
|
||||
alert('验证码加载失败,请刷新页面重试');
|
||||
})
|
||||
});
|
||||
|
||||
var tcaptchaCallback = function(res){
|
||||
if (res.ret === 0) {
|
||||
layer.load(0, {shade:0.1});
|
||||
var data = { url: that.input, ticket: res.ticket, randstr: res.randstr};
|
||||
$.ajax({
|
||||
url: '/api/{$plugin.alias}/queryqq',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
cache: false,
|
||||
success: function (data) {
|
||||
layer.closeAll();
|
||||
if(data.status=='ok'){
|
||||
that.showresult = true;
|
||||
that.result_info = data.data;
|
||||
}else{
|
||||
layer.alert(data.message, {icon: 5});
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
layer.closeAll();
|
||||
layer.msg('服务器错误', {icon: 5});
|
||||
}
|
||||
});
|
||||
}else{
|
||||
layer.msg('请先完成验证',{time:800,icon:2});
|
||||
}
|
||||
}
|
||||
this.captcha1 = new TencentCaptcha('2046626881', tcaptchaCallback);
|
||||
},
|
||||
methods: {
|
||||
checkURL()
|
||||
@@ -123,6 +155,13 @@ new Vue({
|
||||
this.type = type;
|
||||
this.captcha.showCaptcha();
|
||||
},
|
||||
queryqq(){
|
||||
if(this.input.trim() == ''){
|
||||
layer.alert('要查询的网址不能为空');return;
|
||||
}
|
||||
this.checkURL();
|
||||
this.captcha1.show();
|
||||
}
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user