聚合图床源码:360图床/淘宝图床/SM.MS图床/搜狐图床/京东图床/阿里图床/百度图床

聚合图床源码:360图床/淘宝图床/SM.MS图床/搜狐图床/京东图床/阿里图床/百度图床。先选择图床再上传图片,建议使用360或搜狐,阿里GG了,百度不让外链。

<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>聚合图床 - MJJSO小工具 </title>
<meta name="descriptiON" content="图床永久免费图床,支出图床API合作,支持批量上传,即时预览,不限制流量,不限制外链数,永久保存,WB图片服务器,全网CDN图床,高速稳定,支持网页、手机上传,无需插件。支持JPG, GIF, PNG等文件格式。WB图床,围脖是个好图床。">
<meta name="keywords" content="图床,图床API,图床,免费图床,WB图床,淘宝免费图床,淘宝图床,围脖是个好图床,围脖图床,网络图片,图片库,相册,网络相册">
<link rel="stylesheet" >
<link  rel="stylesheet">
<link  rel="stylesheet">
<link  rel="stylesheet">
<link  rel="stylesheet">
<script src="https://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
<style>
body {
    background: #105c9a url(https://ae01.alicdn.com/kf/U01f5d0600dd145eca0722c71ffebfe75C.png) repeat-x scroll 0 -450px;
    overflow-y: scroll;
}
</style>
</head>
<body style="">
        <div>
                <div>
                        <h2>
                                聚合图床
                                <small class="text-muted hidden-xs">免费CDN图床 不限流量 无限外链  永久免费</small>
                        </h2>
                </div>
                <div>
                        <p>
                                可以直接拖拽图片上传~<br>也支持批量上传哦~
                        </p>
                     
                        <div>
                                <input type="file" accept="image/*" multiple="">
                                <button type="button" class="btn btn-lg btn-info">选择本地图片</button>
                                <div>
                                        <label><input name="keke" type="radio" value="360">360图床</label>
                                        <label><input name="keke" type="radio" value="taobao">淘宝图床</label>
                                        <label><input name="keke" type="radio" value="smms">SM.MS图床</label>
                                        <label><input name="keke" type="radio" value="sohu">搜狐图床</label>
                                        <label><input name="keke" type="radio" value="jd">京东图床</label>
                                    <label><input name="keke" checked="checked" type="radio" value="1688">阿里图床</label>
                                        <label><input name="keke" type="radio" value="tieba">百度图床</label>
                                </div>
                        </div>
                        
                        
                        
                        <hr>
                        
                        <textarea id="url-res-txt" rows="5" placeholder="先选择图床再上传图片,建议使用360或搜狐,阿里GG了,百度不让外链。"></textarea>
                     
                     <!-- 图片预览 -->
                        <div>
                                <br><hr>
                        </div>
                </div>
                <div>
                        <p>Copyright&nbsp;©&nbsp;suo.dog <a  target="_blank">MJJ搜索小工具</a>&nbsp;本站不做任何上传的图片保存,且上传后无法删除。请自行斟酌使用</p>
                </div>
        </div>
        <script type="text/javascript">
                $(document).ready(function() {
                        
                        $('.picurl > input').bind('focus mouseover', function() {
                                if (this.value) {
                                        this.select()
                                }
                        });
                        $("input[type='file']").change(function(e) {
                                imagesUpload(this.files)
                        });
                        var obj = $('body');
                        obj.on('dragenter', function(e) {
                                e.stopPropagation();
                                e.preventDefault()
                        });
                        obj.on('dragover', function(e) {
                                e.stopPropagation();
                                e.preventDefault()
                        });
                        obj.on('drop', function(e) {
                                e.preventDefault();
                                imagesUpload(e.originalEvent.dataTransfer.files)
                        })
                });
                
                /**
                  * 普通图片上传
                 */
                var imagesUpload = function(files) {
                        a=$('input:radio:checked').val();
                        var flag = 0;
                        $('textarea').empty();
                        $(files).each(function(key, value) {
                                $('.mselector > button')[0].innerHTML = '上传中';
                                
                                setTimeout(function() {
                                        uurrll = 'https://pic.suo.dog/api/tc.php?type='+a+'&echo=imgurl'
                                        image_form = new FormData();
                                        image_form.append("file", value);
                                
                                        $.ajax({
                                                url: uurrll,
                                                type: 'POST',
                                                data: image_form,
                                                contentType: false,
                                                cache: false,
                                                processData: false,
                                                async: false,
                                                success: function(data) {
                                                        flag++;
                                                        //var jsonData = JSON.stringify(data)
                                                        if (typeof(data) == 'string'){
                                                                imgurl = data
                                                        } else {
                                                                imgurl = data.imgurl
                                                        }
                                                        
                                                        //alert(data)
                                                        $('#url-res-txt').append(imgurl + 'n');
                                                        $('.mselector > button')[0].innerHTML = '成功 ' + flag + '/' + files.length;
                                                        
                                                        // 生成预览图
                                                        var apc = "<img src='" + imgurl + "' referrerpolicy="no-referrer" /><p>&nbsp;</p>";                                                        
                                                        $('.preview').css('display', 'block');
                                                        $(".preview>hr").before(apc)
                                                        
                                                        
                                                        if (flag == $("input[type='file']")[0].files.length) {
                                                                if (typeof imgurl != 'undefined') {
                                                                        $('.mselector > button')[0].innerHTML = '上传成功'
                                                                } else {
                                                                        $('.mselector > button')[0].innerHTML = '上传失败';
                                                                        $('#url-res-txt').append(data.error_msg + 'n');
                                                                        alert(data.error_msg)
                                                                }
                                                        }
                                                        
                                                },
                                                error: function(XMLResponse){
                                                        alert("error:" + XMLResponse.responseText);
                                                }
                                        });
                                        
                                }, 100);
                        })
                };
                
        </script>

</body></html>

赞 (0)