mirror of https://github.com/helloxz/imgurl
修复一些BUG
parent
5d419265a5
commit
7e71450339
|
@ -68,9 +68,9 @@
|
|||
}
|
||||
}
|
||||
public function logout(){
|
||||
echo '您已退出,将在5s后返回首页!';
|
||||
echo '您已退出,将在3s后返回首页!';
|
||||
$this->clean_cookies();
|
||||
header("Refresh:5;url=/");
|
||||
header("Refresh:3;url=/");
|
||||
exit;
|
||||
}
|
||||
//清除COOKIE
|
||||
|
|
|
@ -51,7 +51,10 @@
|
|||
return false;
|
||||
}
|
||||
else{
|
||||
echo '权限不足!';
|
||||
echo "权限不足,请<a href = '/user/login'>重新登录</a> 。";
|
||||
//清除cookies
|
||||
setcookie("user", '', time()-3600,"/");
|
||||
setcookie("token", '', time()-3600,"/");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
@ -71,7 +74,7 @@
|
|||
|
||||
curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36");
|
||||
//伪造reffer
|
||||
curl_setopt ($ch, CURLOPT_REFERER, $url);
|
||||
curl_setopt ($curl, CURLOPT_REFERER, $url);
|
||||
curl_setopt($curl, CURLOPT_FAILONERROR, true);
|
||||
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
|
@ -81,6 +84,7 @@
|
|||
curl_setopt($curl , CURLOPT_TIMEOUT, 60);
|
||||
|
||||
$html = curl_exec($curl);
|
||||
|
||||
curl_close($curl);
|
||||
//返回数据
|
||||
return $html;
|
||||
|
|
|
@ -50,57 +50,3 @@
|
|||
<!-- 首页主要区域END -->
|
||||
</div>
|
||||
</div>
|
||||
<!--Ctrl + V粘贴上传-->
|
||||
<script src = "/static/js/PasteUpload.js"></script>
|
||||
<script>
|
||||
var load1 = document.querySelector("#upimg");
|
||||
|
||||
// 实例化即可
|
||||
new ctrlVUtil({
|
||||
uploadUrl: "/upload/parse",
|
||||
targetElement: load1,
|
||||
isCompleteImg:false,
|
||||
data:{
|
||||
name:"alanzhang",
|
||||
},
|
||||
success:function(data){
|
||||
//转为对象
|
||||
var res = data;
|
||||
//上传成功
|
||||
if(res.code == 200){
|
||||
layer.closeAll('loading');
|
||||
//layer.closeAll('loading');
|
||||
$("#img-thumb a").attr('href','/img/' + res.imgid);
|
||||
$("#img-thumb img").attr('src',res.thumbnail_url);
|
||||
$("#url").val(res.url);
|
||||
$("#html").val("<img src = '" + res.url + "' />");
|
||||
$("#markdown").val("![](" + res.url + ")");
|
||||
$("#bbcode").val("[img]" + res.url + "[/img]");
|
||||
$("#imgshow").show();
|
||||
|
||||
//对图片进行鉴黄识别
|
||||
$.get("/deal/identify/" + res.id,function(data,status){
|
||||
var re = JSON.parse(data);
|
||||
//状态码为400,说明该图片存在异常
|
||||
if(re.code == 400){
|
||||
layer.open({
|
||||
title: '警告!'
|
||||
,content: '您的IP已被记录,请不要上传违规图片!'
|
||||
});
|
||||
}
|
||||
else{
|
||||
console.log(re.code);
|
||||
}
|
||||
});
|
||||
}
|
||||
else{
|
||||
layer.msg(res.msg);
|
||||
}
|
||||
},
|
||||
error: function(error){
|
||||
layer.closeAll('loading');
|
||||
layer.msg('上传失败!');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<!--粘贴上传END-->
|
|
@ -6,7 +6,12 @@
|
|||
<div class="layui-col-lg3">
|
||||
<div id="page-sidebar">
|
||||
<div class = "sidebar">
|
||||
<a href="https://e.aiguobit.com/?from=xiaoz" target="_blank" rel="nofollow noopener"><img class="alignnone size-full wp-image-6279" src="https://www.xiaoz.me/wp-content/uploads/2017/06/netssocks_300.png" /></a>
|
||||
<a href="https://e.aiguobit.com/?from=xiaoz" target="_blank" rel="nofollow noopener"><img src = 'https://i.bmp.ovh/imgs/2019/03/009e7ca037f6a1a2.png' /></a>
|
||||
</div>
|
||||
<div class = "sidebar">
|
||||
<a href="https://dwz.ovh/tencent" target="_blank" rel="nofollow">
|
||||
<img src = 'https://i.bmp.ovh/imgs/2019/03/f77699ba0787ee47.jpg' />
|
||||
</a>
|
||||
</div>
|
||||
<div class = "sidebar">
|
||||
<a href="https://www.xiaoz.me/laoxue" target="_blank" rel="nofollow">
|
||||
|
|
|
@ -105,6 +105,10 @@ layui.use(['upload','form','element','layer'], function(){
|
|||
identify(res.id);
|
||||
//element.progress('up-status', col + '%');
|
||||
}
|
||||
else if(res.code == 0){
|
||||
layer.msg(res.msg);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
,error: function(index, upload){
|
||||
layer.closeAll('loading'); //关闭loading
|
||||
|
|
Loading…
Reference in New Issue