图床
图床一般是指储存图片的服务器,有国内和国外之分。国外的图床由于有空间距离等因素决定访问速度很慢影响图片显示速度。国内也分为单线空间、多线空间和cdn加速三种。
网上有很多很多图床比如:百度图床,新浪图床,360图床,搜狗图床,SM图床图床等等……
小杰给大家带来的是百度图床,新浪图床,360图床,搜狗图床,四合一版本
简约的前端上传模版,ajax方式提交图片到API里面,能快速获取图片的外链
全部代码
<!--
四合一图床上传,支持百度(2M)、搜狗(2M)、360(2M)、新浪(10M)图片上传
作者:Youngxj
博客:https://www.youngxj.cn
Apis:https://wiki.yum6.cn
声明:前端无版权,上传Js由Youngxj编写,调用YoungxjApis接口
-->
<!DOCTYPE html>
<html lang='zh-cn'>
<head>
<meta charset='UTF-8'>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<title>四合一图床上传 - Cdn图床,百度图床,新浪图床,360图床,搜狗图床</title>
<link rel='stylesheet' href='https://cdn.bootcss.com/normalize/5.0.0/normalize.min.css'>
<script src="https://cdn.bootcss.com/jquery/3.3.0/jquery.min.js"></script>
<style>
html,body {height: 100%;margin: 0;padding: 0;}body {font-family: 'lucida grande', 'lucida sans unicode', lucida, helvetica, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;align-items: center;display: flex;}a{text-decoration:none;}#container {max-width: 400px;flex-basis: 100%;margin: 0 auto;background: #FFF;border-radius: 10px;box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);-webkit-box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);overflow: hidden;}#container #hero-img {width: 100%;height: 200px;background: #007bff;}#container #profile-img {width: 160px;height: 160px;margin: -80px auto 0 auto;}#container #profile-img img {width: 100%;background: #FFF;border-radius: 50%;}#container #content {text-align: center;width: 320px;margin: 0 auto;padding: 0 0 50px 0;}#container #content h1 {font-size: 29px;font-weight: 500;margin: 30px 0 0 0;}#container #content p {font-size: 18px;font-weight: 400;line-height: 1.4;color: #666;margin: 15px 0 40px 0;}#container #content a {color: #CCC;font-size: 14px