content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
蓝奏云在线解析- 聚合解析
蓝奏云链接
class="layui-input">
是否有密码
lay-text="有|无">
蓝奏云密码
class="layui-input">
解析
layui.$(function () {
layui.use(['form', 'table'], function () {
var form = layui.form, table = layui.table;
form.render();
table.render({
elem: '#demo'
, url: 'https://code.oioweb.cn/lanzou/msg.php'
, size: "sm"
, even: true
, cols: [[
{field: 'url', title: '蓝奏云链接', align: "center"}
, {field: 'ip', title: 'IP', align: "center"}
, {field: 'terminal', title: '设备', align: "center"}
, {field: 'time', title: '时间', align: "center"}
]]
});
form.on('switch(encrypt)', function (data) {
if (data.elem.checked) {
layui.$('.layui-progres').removeClass('layui-hide');
} else {
layui.$('.layui-progres').addClass('layui-hide');
}
});
form.on('submit(*)', function (data) {
if (data.field.url === "") {
layer.msg("请输入链接再解析");
return false;
}
if (data.field.switch === "on") {
if (data.field.pwd === "") {
layer.msg("请输入密码");
return false;
}
if (data.field.pwd.length > 6) {
layer.msg("密码不符合规则");
return false;
}
}
if (data.field.url.indexOf("lanzous.com") === -1) {
layer.msg("这不是蓝奏云链接");
return false;
}
layui.$.ajax({
type: "POST",
url: "https://code.oioweb.cn/lanzou/api.php",
data: data.field,
dataType: "JSON",
beforeSend: function () {
layer.load();
}, success: function (data) {
layer.closeAll('loading');
if (data.code === 1) {
layer.msg(data.msg);
layer.alert(data.url, {
btn: ['下载', '复制'],
success: function (layero) {
var btn = layero.find('.layui-layer-btn');
btn.find('.layui-layer-btn0').attr({
href: data.url
, target: '_blank'
});
}
});
var clipboard = new ClipboardJS('.layui-layer-btn1', {
text: function () {
return data.url;
}
});
clipboard.on('success', function (e) {
layer.msg("复制成功");
clipboard.destroy();
});
} else {
layer.msg(data.msg);
}
}, error: function () {
layer.closeAll('loading');
layer.msg("服务器错误");
}
})
return false;
});
});
})
一键复制
编辑
Web IDE
原始数据
按行查看
历史