更新layui库
完成设置Banner和设置活动的页面 redis设置时间为-1时则为永久保存
This commit is contained in:
parent
ec6f658935
commit
9dcee52750
@ -1 +0,0 @@
|
||||
123
|
@ -1,101 +1,118 @@
|
||||
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>Banner设置</title>
|
||||
</head>
|
||||
<link rel="stylesheet" href="/static/layui/css/layui.css">
|
||||
<script src="/static/layui/layui.all.js"></script>
|
||||
<script src="/static/layui/layui.js"></script>
|
||||
<script src="/static/js/jquery-3.2.1.js"></script>
|
||||
<script src="/static/js/user.js"></script>
|
||||
<body>
|
||||
<table id="banner" lay-filter="banner"></table>
|
||||
</body>
|
||||
<script type="text/html" id="bar">
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>Banner设置</title>
|
||||
</head>
|
||||
<link rel="stylesheet" href="/static/layui/css/layui.css">
|
||||
<script src="/static/layui/layui.all.js"></script>
|
||||
<script src="/static/layui/layui.js"></script>
|
||||
<script src="/static/js/jquery-3.2.1.js"></script>
|
||||
<script src="/static/js/user.js"></script>
|
||||
|
||||
<body>
|
||||
<table id="banner" lay-filter="banner"></table>
|
||||
</body>
|
||||
<script type="text/html" id="bar">
|
||||
<a class="layui-btn layui-btn-xs" lay-event="url">URL</a>
|
||||
<a class="layui-btn layui-btn-xs" lay-event="click">点击地址</a>
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="state">上/下线</a>
|
||||
</script>
|
||||
<script>
|
||||
layui.use('table', function() {
|
||||
var table = layui.table;
|
||||
table.render({
|
||||
elem: '#banner',
|
||||
height: 312,
|
||||
url: '/android/banner/get.do?all=true',
|
||||
page: false,
|
||||
response: {
|
||||
statusCode: 100
|
||||
<script>
|
||||
layui.use('table', function () {
|
||||
var table = layui.table;
|
||||
table.render({
|
||||
elem: '#banner',
|
||||
height: 312,
|
||||
url: '/android/banner/get.do?all=true',
|
||||
page: false,
|
||||
response: {
|
||||
statusCode: 100
|
||||
},
|
||||
cols: [
|
||||
[{
|
||||
field: 'id',
|
||||
title: 'id',
|
||||
width: 80,
|
||||
sort: true,
|
||||
fixed: 'left'
|
||||
}, {
|
||||
field: 'url',
|
||||
title: '图片链接',
|
||||
width: 300,
|
||||
},
|
||||
cols: [
|
||||
[{
|
||||
field: 'id',
|
||||
title: 'id',
|
||||
width: 80,
|
||||
sort: true,
|
||||
fixed: 'left'
|
||||
}, {
|
||||
field: 'url',
|
||||
title: '图片链接',
|
||||
width: 300,
|
||||
},
|
||||
{
|
||||
field: 'click',
|
||||
title: '跳转地址',
|
||||
width: 300,
|
||||
},
|
||||
{
|
||||
field: 'isshow',
|
||||
title: '是否显示',
|
||||
width: 120,
|
||||
}, {
|
||||
fixed: 'right',
|
||||
width: 200,
|
||||
align: 'center',
|
||||
toolbar: '#bar'
|
||||
}
|
||||
]
|
||||
{
|
||||
field: 'click',
|
||||
title: '跳转地址',
|
||||
width: 300,
|
||||
},
|
||||
{
|
||||
field: 'isshow',
|
||||
title: '是否显示',
|
||||
width: 120,
|
||||
}, {
|
||||
fixed: 'right',
|
||||
width: 200,
|
||||
align: 'center',
|
||||
toolbar: '#bar'
|
||||
}
|
||||
]
|
||||
})
|
||||
table.on('tool(banner)', function(obj) {
|
||||
var data = obj.data;
|
||||
if (obj.event === 'url') {
|
||||
layer.prompt(function(value, index, elem) {
|
||||
layer.close(index);
|
||||
layer.msg(value)
|
||||
active['reload'](this)
|
||||
});
|
||||
} else if (obj.event === 'click') {
|
||||
layer.prompt(function(value, index, elem) {
|
||||
layer.close(index);
|
||||
layer.msg(value)
|
||||
active['reload'](this)
|
||||
});
|
||||
} else if (obj.event == 'state') {
|
||||
layer.prompt(function(value, index, elem) {
|
||||
layer.close(index);
|
||||
layer.msg(value)
|
||||
active['reload'](this)
|
||||
]
|
||||
})
|
||||
table.on('tool(banner)', function (obj) {
|
||||
var data = obj.data;
|
||||
if (obj.event === 'url') {
|
||||
layer.prompt(function (value, index, elem) {
|
||||
layer.close(index);
|
||||
console.log(data.state)
|
||||
var that = this;
|
||||
$.post("/admin/magicbox/banner.do", { 'id': data.id, 'url': value, 'click':data.click,'state':data.isshow}, function (data) {
|
||||
var json = JSON.parse(data);
|
||||
layer.alert(json.msg)
|
||||
active['reload'](that)
|
||||
})
|
||||
|
||||
});
|
||||
} else if (obj.event === 'click') {
|
||||
layer.prompt(function (value, index, elem) {
|
||||
layer.close(index);
|
||||
|
||||
var that = this;
|
||||
$.post("/admin/magicbox/banner.do", { 'id': data.id, 'url':data.url,'click': value ,'state':data.isshow}, function (data) {
|
||||
var json = JSON.parse(data);
|
||||
layer.alert(json.msg)
|
||||
active['reload'](that)
|
||||
})
|
||||
});
|
||||
} else if (obj.event == 'state') {
|
||||
layer.prompt(function (value, index, elem) {
|
||||
layer.close(index);
|
||||
|
||||
var that = this;
|
||||
$.post("/admin/magicbox/banner.do", { 'id': data.id,'url': data.url, 'click':data.click, 'state': value }, function (data) {
|
||||
var json = JSON.parse(data);
|
||||
layer.alert(json.msg)
|
||||
active['reload'](that)
|
||||
})
|
||||
});
|
||||
}
|
||||
})
|
||||
var $ = layui.$,
|
||||
active = {
|
||||
reload: function () {
|
||||
//执行重载
|
||||
table.reload('banner', {
|
||||
page: {
|
||||
curr: 1 //重新从第 1 页开始
|
||||
},
|
||||
where: {
|
||||
type: $('#searchType').val(),
|
||||
key: $('#searchKey').val()
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
var $ = layui.$,
|
||||
active = {
|
||||
reload: function() {
|
||||
//执行重载
|
||||
table.reload('banner', {
|
||||
page: {
|
||||
curr: 1 //重新从第 1 页开始
|
||||
},
|
||||
where: {
|
||||
type: $('#searchType').val(),
|
||||
key: $('#searchKey').val()
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
})
|
||||
</script>
|
||||
</html>
|
||||
};
|
||||
})
|
||||
</script>
|
||||
|
||||
</html>
|
@ -1,58 +1,71 @@
|
||||
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>盒子倒计时设置</title>
|
||||
</head>
|
||||
<link rel="stylesheet" href="/static/layui/css/layui.css">
|
||||
<script src="/static/layui/layui.all.js"></script>
|
||||
<script src="/static/layui/layui.js"></script>
|
||||
<script src="/static/js/jquery-3.2.1.js"></script>
|
||||
<script src="/static/js/user.js"></script>
|
||||
<body>
|
||||
<form class="layui-form" action="" style="width: 60%;">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">标题</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="title" required lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>盒子倒计时设置</title>
|
||||
</head>
|
||||
<link rel="stylesheet" href="/static/layui/css/layui.css">
|
||||
<script src="/static/layui/layui.all.js"></script>
|
||||
<script src="/static/layui/layui.js"></script>
|
||||
<script src="/static/js/jquery-3.2.1.js"></script>
|
||||
<script src="/static/js/user.js"></script>
|
||||
|
||||
<body>
|
||||
<form class="layui-form" action="" style="width: 60%;">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">标题</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="title" required lay-verify="required" placeholder="请输入标题" autocomplete="off"
|
||||
class="layui-input">
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">开始时间</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="button" id="start" required lay-verify="required" placeholder="开始时间" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">URL</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="url" required lay-verify="required" placeholder="请输入活动地址" autocomplete="off"
|
||||
class="layui-input">
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">结束时间</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="button" id="end" required lay-verify="required" placeholder="结束时间" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">开始时间</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="button" id="start" required lay-verify="required" placeholder="开始时间" autocomplete="off"
|
||||
class="layui-input">
|
||||
</div>
|
||||
<div class="layui-form-item" style="margin-left: 85%;">
|
||||
<input id="subbutton" type="button" value="提交" class="layui-btn" />
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">结束时间</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="button" id="end" required lay-verify="required" placeholder="结束时间" autocomplete="off"
|
||||
class="layui-input">
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
<script>
|
||||
layui.use('laydate', function() {
|
||||
var laydate = layui.laydate;
|
||||
var form = layui.form;
|
||||
|
||||
laydate.render({
|
||||
elem: '#start' ,
|
||||
type:'datetime',
|
||||
min:0
|
||||
});
|
||||
laydate.render({
|
||||
elem:'#end',
|
||||
type:'datetime',
|
||||
min:0
|
||||
})
|
||||
</div>
|
||||
<div class="layui-form-item" style="margin-left: 85%;">
|
||||
<input id="subbutton" type="button" value="提交" class="layui-btn" />
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
<script>
|
||||
layui.use('laydate', function () {
|
||||
var laydate = layui.laydate;
|
||||
var form = layui.form;
|
||||
|
||||
laydate.render({
|
||||
elem: '#start',
|
||||
type: 'datetime'
|
||||
});
|
||||
$('#subbutton').click(function(event){
|
||||
|
||||
laydate.render({
|
||||
elem: '#end',
|
||||
type: 'datetime',
|
||||
min: 0
|
||||
})
|
||||
});
|
||||
$('#subbutton').click(function (event) {
|
||||
$.post("/admin/magicbox/activity.do", { 'title': $('#title').val(), 'url': $('#url').val(), 'start': $('#start').val(), 'end': $('#end').val() }, function (data) {
|
||||
var json = JSON.parse(data);
|
||||
layer.alert(json.msg)
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</html>
|
||||
</script>
|
||||
|
||||
</html>
|
358
html/home.html
358
html/home.html
@ -1,191 +1,199 @@
|
||||
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>个人中心</title>
|
||||
<link rel="stylesheet" href="/static/layui/css/layui.css">
|
||||
<link rel="stylesheet" href="/static/layui/css/modules/layer/default/layer.css">
|
||||
<script src="../static/layui/layui.js"></script>
|
||||
<script src="../static/layui/lay/modules/layer.js"></script>
|
||||
<script src="../static/js/jquery-3.2.1.js"></script>
|
||||
<script src="../static/js/user.js"></script>
|
||||
</head>
|
||||
<body class="layui-layout-body">
|
||||
<div class="layui-layout layui-layout-admin">
|
||||
<div class="layui-header">
|
||||
<div class="layui-logo" id="title">魔改宝盒</div>
|
||||
<ul class="layui-nav layui-layout-left">
|
||||
<li class="layui-nav-item"><a href="">我的</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a href="">消息管理</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="layui-nav layui-layout-right">
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>个人中心</title>
|
||||
<link rel="stylesheet" href="/static/layui/css/layui.css">
|
||||
<link rel="stylesheet" href="/static/layui/css/modules/layer/default/layer.css">
|
||||
<script src="../static/layui/layui.js"></script>
|
||||
<script src="../static/layui/lay/modules/layer.js"></script>
|
||||
<script src="../static/js/jquery-3.2.1.js"></script>
|
||||
<script src="../static/js/user.js"></script>
|
||||
</head>
|
||||
|
||||
<body class="layui-layout-body">
|
||||
<div class="layui-layout layui-layout-admin">
|
||||
<div class="layui-header">
|
||||
<div class="layui-logo" id="title">魔改宝盒</div>
|
||||
<ul class="layui-nav layui-layout-left">
|
||||
<li class="layui-nav-item"><a href="">我的</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a href="">消息管理</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="layui-nav layui-layout-right">
|
||||
<li class="layui-nav-item">
|
||||
<a href="#">
|
||||
<img id="ic_user" src="http://t.cn/RCzsdCq" class="layui-nav-img">
|
||||
<font id="uname">用户名</font>
|
||||
</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd id="userData"><a href="javascript:;">基本资料</a></dd>
|
||||
<dd id="security"><a href="javascript:;">安全设置</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="layui-nav-item"><a href="javascript:logout();">注销</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="layui-side layui-bg-black">
|
||||
<div class="layui-side-scroll">
|
||||
<ul class="layui-nav layui-nav-tree">
|
||||
<li class="layui-nav-item layui-this" id='main'><a href="javascript:;">主页</a></li>
|
||||
<li class="layui-nav-item">
|
||||
<a href="#">
|
||||
<img id="ic_user" src="http://t.cn/RCzsdCq" class="layui-nav-img">
|
||||
<font id="uname">用户名</font>
|
||||
</a>
|
||||
<a class="" href="#">盒子中心</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd id="userData"><a href="javascript:;">基本资料</a></dd>
|
||||
<dd id="security"><a href="javascript:;">安全设置</a></dd>
|
||||
<dd id='mymod'><a href="javascript:;">我的盒子</a></dd>
|
||||
<dd id='upmod'><a href="javascript:;">上传器</a></dd>
|
||||
<dd><a href="javascript:;">别人的盒子</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="layui-nav-item"><a href="javascript:logout();">注销</a></li>
|
||||
<li class="layui-nav-item">
|
||||
<a href="javascript:;">数据中心</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a href="javascript:;">我的数据</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="layui-nav-item" id="hezi" name="hezi">
|
||||
<a href="javascript:;">管理盒子</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd id="countdown"><a href="javascript:;">倒计时设置</a></dd>
|
||||
<dd id="banner"><a href="javascript:;">Banner</a></dd>
|
||||
<dd><a href="javascript:;">推广</a></dd>
|
||||
<dd><a href="javascript:;">工具</a></dd>
|
||||
<dd><a href="javascript:;">魔改</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="layui-nav-item" id="system" name="system">
|
||||
<a href="javascript:;">用户管理</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd id='users'><a href="javascript:;">用户列表</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="layui-nav-item" id='permission'><a href="javascript:;">权限申请</a></li>
|
||||
<li class="layui-nav-item" id='feedback'><a href="javascript:;">提供建议/反馈BUG</a></li>
|
||||
<li class="layui-nav-item" id='join'><a href="javascript:;">加入我们</a></li>
|
||||
<li class="layui-nav-item" id='about'><a href="javascript:;">关于我们</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="layui-side layui-bg-black">
|
||||
<div class="layui-side-scroll">
|
||||
<ul class="layui-nav layui-nav-tree">
|
||||
<li class="layui-nav-item layui-this" id='main'><a href="javascript:;">主页</a></li>
|
||||
<li class="layui-nav-item">
|
||||
<a class="" href="#">盒子中心</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd id='mymod'><a href="javascript:;">我的盒子</a></dd>
|
||||
<dd id='upmod'><a href="javascript:;">上传器</a></dd>
|
||||
<dd><a href="javascript:;">别人的盒子</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a href="javascript:;">数据中心</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a href="javascript:;">我的数据</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="layui-nav-item" id="hezi" name="hezi">
|
||||
<a href="javascript:;">管理盒子</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd id="countdown"><a href="javascript:;">倒计时设置</a></dd>
|
||||
<dd id="banner"><a href="javascript:;">Banner</a></dd>
|
||||
<dd><a href="javascript:;">推广</a></dd>
|
||||
<dd><a href="javascript:;">工具</a></dd>
|
||||
<dd><a href="javascript:;">魔改</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="layui-nav-item" id="system" name="system">
|
||||
<a href="javascript:;">用户管理</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd id='users'><a href="javascript:;">用户列表</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="layui-nav-item" id='permission'><a href="javascript:;">权限申请</a></li>
|
||||
<li class="layui-nav-item" id='problem'><a href="javascript:;">提供建议/反馈BUG</a></li>
|
||||
<li class="layui-nav-item" id='join'><a href="javascript:;">加入我们</a></li>
|
||||
<li class="layui-nav-item" id='about'><a href="javascript:;">关于我们</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-body">
|
||||
<div style="padding: 15px;">
|
||||
<iframe src="html/main.html" id='context' frameborder="0" onload="changeFrameHeight()"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-footer">
|
||||
©2019 <a href="http://jianrmod.cn">jianrmod.cn</a> - 舰R魔改宝盒小组
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
//JavaScript代码区域
|
||||
layui.use('element', function() {
|
||||
var element = layui.element;
|
||||
<div class="layui-body">
|
||||
<div style="padding: 15px;">
|
||||
<iframe src="html/main.html" id='context' frameborder="0" onload="changeFrameHeight()"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
});
|
||||
$('#security').click(function(event) {
|
||||
layer.open({
|
||||
title: "重置密码",
|
||||
content: "将发送重置密码邮件到您的邮箱",
|
||||
yes: function(index, event) {
|
||||
layer.close(index);
|
||||
$.post("/user/repassword.do", function(data) {
|
||||
var json = JSON.parse(data);
|
||||
layer.alert(json.msg);
|
||||
})
|
||||
}
|
||||
});
|
||||
})
|
||||
$('#banner').click(function(event) {
|
||||
$(document).attr('title', "Banner管理");
|
||||
$('#context').attr('src', '/admin/magbox/Banner.html');
|
||||
})
|
||||
$('#countdown').click(function(event) {
|
||||
$(document).attr('title', "倒计时管理");
|
||||
$('#context').attr('src', '/admin/magbox/Countdown.html');
|
||||
})
|
||||
$('#users').click(function(event) {
|
||||
$(document).attr('title', '用户列表');
|
||||
$('#context').attr('src', "admin/system/userlist.html");
|
||||
})
|
||||
$('#title').click(function(event) {
|
||||
$(document).attr('title', '个人中心');
|
||||
window.location.href = "home.html"
|
||||
})
|
||||
$('#main').click(function(event) {
|
||||
$(document).attr('title', '个人中心');
|
||||
$('#context').attr('src', '/html/main.html');
|
||||
})
|
||||
$('#join').click(function(event) {
|
||||
$(document).attr('title', '加入我们');
|
||||
$('#context').attr('src', '/html/join.html');
|
||||
})
|
||||
$('#about').click(function(event) {
|
||||
$(document).attr('title', '关于我们');
|
||||
$('#context').attr('src', '/html/about.html');
|
||||
})
|
||||
$('#upmod').click(function(event) {
|
||||
$(document).attr('title', '魔改上传器');
|
||||
$('#context').attr('src', '/html/upmod.html');
|
||||
})
|
||||
$('#mymod').click(function(event) {
|
||||
$(document).attr('title', '我的魔改');
|
||||
$('#context').attr('src', '/html/mymod.html');
|
||||
})
|
||||
$('#userData').click(function(event) {
|
||||
$(document).attr('title', '基本资料');
|
||||
$('#context').attr('src', '/html/userData.html');
|
||||
})
|
||||
$('#permission').click(function(event) {
|
||||
$(document).attr('title', '申请权限');
|
||||
$('#context').attr('src', '/html/permission.html');
|
||||
})
|
||||
$.post("/user/udata.do", function(data, textStatus, req) {
|
||||
var json = JSON.parse(data);
|
||||
console.log(data)
|
||||
$('#uname').text(json.data.user.uname);
|
||||
$('#ic_user').attr("src", json.data.userdata.image)
|
||||
try {
|
||||
<div class="layui-footer">
|
||||
©2019 <a href="http://jianrmod.cn">jianrmod.cn</a> - 舰R魔改宝盒小组
|
||||
</div>
|
||||
</div>
|
||||
|
||||
var pw =json.data.user.power;
|
||||
if (pw == '') {
|
||||
location.reload();
|
||||
return;
|
||||
}
|
||||
if (json.data.user.power < pw) {
|
||||
$('#hezi').hide();
|
||||
$('#system').hide();
|
||||
}
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
location.reload();
|
||||
<script>
|
||||
//JavaScript代码区域
|
||||
layui.use('element', function () {
|
||||
var element = layui.element;
|
||||
|
||||
});
|
||||
$('#security').click(function (event) {
|
||||
layer.open({
|
||||
title: "重置密码",
|
||||
content: "将发送重置密码邮件到您的邮箱",
|
||||
yes: function (index, event) {
|
||||
layer.close(index);
|
||||
$.post("/user/repassword.do", function (data) {
|
||||
var json = JSON.parse(data);
|
||||
layer.alert(json.msg);
|
||||
})
|
||||
}
|
||||
});
|
||||
})
|
||||
$('#banner').click(function (event) {
|
||||
$(document).attr('title', "Banner管理");
|
||||
$('#context').attr('src', '/admin/magbox/Banner.html');
|
||||
})
|
||||
$('#countdown').click(function (event) {
|
||||
$(document).attr('title', "倒计时管理");
|
||||
$('#context').attr('src', '/admin/magbox/Countdown.html');
|
||||
})
|
||||
$('#users').click(function (event) {
|
||||
$(document).attr('title', '用户列表');
|
||||
$('#context').attr('src', "admin/system/userlist.html");
|
||||
})
|
||||
$('#title').click(function (event) {
|
||||
$(document).attr('title', '个人中心');
|
||||
window.location.href = "home.html"
|
||||
})
|
||||
$('#main').click(function (event) {
|
||||
$(document).attr('title', '个人中心');
|
||||
$('#context').attr('src', '/html/main.html');
|
||||
})
|
||||
$('#join').click(function (event) {
|
||||
$(document).attr('title', '加入我们');
|
||||
$('#context').attr('src', '/html/join.html');
|
||||
})
|
||||
$('#about').click(function (event) {
|
||||
$(document).attr('title', '关于我们');
|
||||
$('#context').attr('src', '/html/about.html');
|
||||
})
|
||||
$('#upmod').click(function (event) {
|
||||
$(document).attr('title', '魔改上传器');
|
||||
$('#context').attr('src', '/html/upmod.html');
|
||||
})
|
||||
$('#mymod').click(function (event) {
|
||||
$(document).attr('title', '我的魔改');
|
||||
$('#context').attr('src', '/html/mymod.html');
|
||||
})
|
||||
$('#userData').click(function (event) {
|
||||
$(document).attr('title', '基本资料');
|
||||
$('#context').attr('src', '/html/userData.html');
|
||||
})
|
||||
$('#permission').click(function (event) {
|
||||
$(document).attr('title', '申请权限');
|
||||
$('#context').attr('src', '/html/permission.html');
|
||||
})
|
||||
$.post("/user/udata.do", function (data, textStatus, req) {
|
||||
var json = JSON.parse(data);
|
||||
console.log(data)
|
||||
$('#uname').text(json.data.user.uname);
|
||||
$('#ic_user').attr("src", json.data.userdata.image)
|
||||
try {
|
||||
|
||||
var pw = json.data.user.power;
|
||||
if (pw == '') {
|
||||
location.reload();
|
||||
return;
|
||||
}
|
||||
if (json.data.user.power < pw) {
|
||||
$('#hezi').hide();
|
||||
$('#system').hide();
|
||||
}
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
location.reload();
|
||||
}
|
||||
|
||||
})
|
||||
$('#feedback').click(function (event) {
|
||||
layer.prompt(function (value, index) {
|
||||
layer.close(index)
|
||||
$.post('/android/system/addFeedBack.do', { 'context': value, 'sysinfo': 'web' }, function (data) {
|
||||
var json = JSON.parse(data);
|
||||
layer.alert(json.msg)
|
||||
})
|
||||
})
|
||||
})
|
||||
function changeFrameHeight() {
|
||||
var ifm = document.getElementById("context");
|
||||
ifm.height = document.documentElement.clientHeight;
|
||||
ifm.width = document.documentElement.clientWidth;
|
||||
}
|
||||
|
||||
window.onresize = function () {
|
||||
changeFrameHeight();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
function changeFrameHeight() {
|
||||
var ifm = document.getElementById("context");
|
||||
ifm.height = document.documentElement.clientHeight;
|
||||
ifm.width = document.documentElement.clientWidth;
|
||||
}
|
||||
window.onresize = function() {
|
||||
changeFrameHeight();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,2 +1,2 @@
|
||||
/** layui-v2.4.5 MIT License By https://www.layui.com */
|
||||
/** layui-v2.5.6 MIT License By https://www.layui.com */
|
||||
html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #e2e2e2;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:32px;line-height:32px;border-bottom:1px solid #e2e2e2}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 5px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 274 KiB After Width: | Height: | Size: 299 KiB |
Binary file not shown.
Binary file not shown.
@ -1,2 +1,2 @@
|
||||
/** layui-v2.4.5 MIT License By https://www.layui.com */
|
||||
;layui.define("jquery",function(e){"use strict";var i=layui.$,n=(layui.hint(),layui.device(),{config:{},set:function(e){var n=this;return n.config=i.extend({},n.config,e),n},on:function(e,i){return layui.onevent.call(this,t,e,i)}}),t="carousel",a="layui-this",l=">*[carousel-item]>*",o="layui-carousel-left",r="layui-carousel-right",d="layui-carousel-prev",s="layui-carousel-next",u="layui-carousel-arrow",c="layui-carousel-ind",m=function(e){var t=this;t.config=i.extend({},t.config,n.config,e),t.render()};m.prototype.config={width:"600px",height:"280px",full:!1,arrow:"hover",indicator:"inside",autoplay:!0,interval:3e3,anim:"",trigger:"click",index:0},m.prototype.render=function(){var e=this,n=e.config;n.elem=i(n.elem),n.elem[0]&&(e.elemItem=n.elem.find(l),n.index<0&&(n.index=0),n.index>=e.elemItem.length&&(n.index=e.elemItem.length-1),n.interval<800&&(n.interval=800),n.full?n.elem.css({position:"fixed",width:"100%",height:"100%",zIndex:9999}):n.elem.css({width:n.width,height:n.height}),n.elem.attr("lay-anim",n.anim),e.elemItem.eq(n.index).addClass(a),e.elemItem.length<=1||(e.indicator(),e.arrow(),e.autoplay(),e.events()))},m.prototype.reload=function(e){var n=this;clearInterval(n.timer),n.config=i.extend({},n.config,e),n.render()},m.prototype.prevIndex=function(){var e=this,i=e.config,n=i.index-1;return n<0&&(n=e.elemItem.length-1),n},m.prototype.nextIndex=function(){var e=this,i=e.config,n=i.index+1;return n>=e.elemItem.length&&(n=0),n},m.prototype.addIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index+e,n.index>=i.elemItem.length&&(n.index=0)},m.prototype.subIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index-e,n.index<0&&(n.index=i.elemItem.length-1)},m.prototype.autoplay=function(){var e=this,i=e.config;i.autoplay&&(e.timer=setInterval(function(){e.slide()},i.interval))},m.prototype.arrow=function(){var e=this,n=e.config,t=i(['<button class="layui-icon '+u+'" lay-type="sub">'+("updown"===n.anim?"":"")+"</button>",'<button class="layui-icon '+u+'" lay-type="add">'+("updown"===n.anim?"":"")+"</button>"].join(""));n.elem.attr("lay-arrow",n.arrow),n.elem.find("."+u)[0]&&n.elem.find("."+u).remove(),n.elem.append(t),t.on("click",function(){var n=i(this),t=n.attr("lay-type");e.slide(t)})},m.prototype.indicator=function(){var e=this,n=e.config,t=e.elemInd=i(['<div class="'+c+'"><ul>',function(){var i=[];return layui.each(e.elemItem,function(e){i.push("<li"+(n.index===e?' class="layui-this"':"")+"></li>")}),i.join("")}(),"</ul></div>"].join(""));n.elem.attr("lay-indicator",n.indicator),n.elem.find("."+c)[0]&&n.elem.find("."+c).remove(),n.elem.append(t),"updown"===n.anim&&t.css("margin-top",-(t.height()/2)),t.find("li").on("hover"===n.trigger?"mouseover":n.trigger,function(){var t=i(this),a=t.index();a>n.index?e.slide("add",a-n.index):a<n.index&&e.slide("sub",n.index-a)})},m.prototype.slide=function(e,i){var n=this,l=n.elemItem,u=n.config,c=u.index,m=u.elem.attr("lay-filter");n.haveSlide||("sub"===e?(n.subIndex(i),l.eq(u.index).addClass(d),setTimeout(function(){l.eq(c).addClass(r),l.eq(u.index).addClass(r)},50)):(n.addIndex(i),l.eq(u.index).addClass(s),setTimeout(function(){l.eq(c).addClass(o),l.eq(u.index).addClass(o)},50)),setTimeout(function(){l.removeClass(a+" "+d+" "+s+" "+o+" "+r),l.eq(u.index).addClass(a),n.haveSlide=!1},300),n.elemInd.find("li").eq(u.index).addClass(a).siblings().removeClass(a),n.haveSlide=!0,layui.event.call(this,t,"change("+m+")",{index:u.index,prevIndex:c,item:l.eq(u.index)}))},m.prototype.events=function(){var e=this,i=e.config;i.elem.data("haveEvents")||(i.elem.on("mouseenter",function(){clearInterval(e.timer)}).on("mouseleave",function(){e.autoplay()}),i.elem.data("haveEvents",!0))},n.render=function(e){var i=new m(e);return i},e(t,n)});
|
||||
/** layui-v2.5.6 MIT License By https://www.layui.com */
|
||||
;layui.define("jquery",function(e){"use strict";var i=layui.$,n=(layui.hint(),layui.device(),{config:{},set:function(e){var n=this;return n.config=i.extend({},n.config,e),n},on:function(e,i){return layui.onevent.call(this,t,e,i)}}),t="carousel",a="layui-this",l=">*[carousel-item]>*",o="layui-carousel-left",r="layui-carousel-right",d="layui-carousel-prev",s="layui-carousel-next",u="layui-carousel-arrow",c="layui-carousel-ind",m=function(e){var t=this;t.config=i.extend({},t.config,n.config,e),t.render()};m.prototype.config={width:"600px",height:"280px",full:!1,arrow:"hover",indicator:"inside",autoplay:!0,interval:3e3,anim:"",trigger:"click",index:0},m.prototype.render=function(){var e=this,n=e.config;n.elem=i(n.elem),n.elem[0]&&(e.elemItem=n.elem.find(l),n.index<0&&(n.index=0),n.index>=e.elemItem.length&&(n.index=e.elemItem.length-1),n.interval<800&&(n.interval=800),n.full?n.elem.css({position:"fixed",width:"100%",height:"100%",zIndex:9999}):n.elem.css({width:n.width,height:n.height}),n.elem.attr("lay-anim",n.anim),e.elemItem.eq(n.index).addClass(a),e.elemItem.length<=1||(e.indicator(),e.arrow(),e.autoplay(),e.events()))},m.prototype.reload=function(e){var n=this;clearInterval(n.timer),n.config=i.extend({},n.config,e),n.render()},m.prototype.prevIndex=function(){var e=this,i=e.config,n=i.index-1;return n<0&&(n=e.elemItem.length-1),n},m.prototype.nextIndex=function(){var e=this,i=e.config,n=i.index+1;return n>=e.elemItem.length&&(n=0),n},m.prototype.addIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index+e,n.index>=i.elemItem.length&&(n.index=0)},m.prototype.subIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index-e,n.index<0&&(n.index=i.elemItem.length-1)},m.prototype.autoplay=function(){var e=this,i=e.config;i.autoplay&&(clearInterval(e.timer),e.timer=setInterval(function(){e.slide()},i.interval))},m.prototype.arrow=function(){var e=this,n=e.config,t=i(['<button class="layui-icon '+u+'" lay-type="sub">'+("updown"===n.anim?"":"")+"</button>",'<button class="layui-icon '+u+'" lay-type="add">'+("updown"===n.anim?"":"")+"</button>"].join(""));n.elem.attr("lay-arrow",n.arrow),n.elem.find("."+u)[0]&&n.elem.find("."+u).remove(),n.elem.append(t),t.on("click",function(){var n=i(this),t=n.attr("lay-type");e.slide(t)})},m.prototype.indicator=function(){var e=this,n=e.config,t=e.elemInd=i(['<div class="'+c+'"><ul>',function(){var i=[];return layui.each(e.elemItem,function(e){i.push("<li"+(n.index===e?' class="layui-this"':"")+"></li>")}),i.join("")}(),"</ul></div>"].join(""));n.elem.attr("lay-indicator",n.indicator),n.elem.find("."+c)[0]&&n.elem.find("."+c).remove(),n.elem.append(t),"updown"===n.anim&&t.css("margin-top",-(t.height()/2)),t.find("li").on("hover"===n.trigger?"mouseover":n.trigger,function(){var t=i(this),a=t.index();a>n.index?e.slide("add",a-n.index):a<n.index&&e.slide("sub",n.index-a)})},m.prototype.slide=function(e,i){var n=this,l=n.elemItem,u=n.config,c=u.index,m=u.elem.attr("lay-filter");n.haveSlide||("sub"===e?(n.subIndex(i),l.eq(u.index).addClass(d),setTimeout(function(){l.eq(c).addClass(r),l.eq(u.index).addClass(r)},50)):(n.addIndex(i),l.eq(u.index).addClass(s),setTimeout(function(){l.eq(c).addClass(o),l.eq(u.index).addClass(o)},50)),setTimeout(function(){l.removeClass(a+" "+d+" "+s+" "+o+" "+r),l.eq(u.index).addClass(a),n.haveSlide=!1},300),n.elemInd.find("li").eq(u.index).addClass(a).siblings().removeClass(a),n.haveSlide=!0,layui.event.call(this,t,"change("+m+")",{index:u.index,prevIndex:c,item:l.eq(u.index)}))},m.prototype.events=function(){var e=this,i=e.config;i.elem.data("haveEvents")||(i.elem.on("mouseenter",function(){clearInterval(e.timer)}).on("mouseleave",function(){e.autoplay()}),i.elem.data("haveEvents",!0))},n.render=function(e){var i=new m(e);return i},e(t,n)});
|
@ -1,2 +1,2 @@
|
||||
/** layui-v2.4.5 MIT License By https://www.layui.com */
|
||||
/** layui-v2.5.6 MIT License By https://www.layui.com */
|
||||
;layui.define("jquery",function(e){"use strict";var a=layui.$,l="http://www.layui.com/doc/modules/code.html";e("code",function(e){var t=[];e=e||{},e.elem=a(e.elem||".layui-code"),e.about=!("about"in e)||e.about,e.elem.each(function(){t.push(this)}),layui.each(t.reverse(),function(t,i){var c=a(i),o=c.html();(c.attr("lay-encode")||e.encode)&&(o=o.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""")),c.html('<ol class="layui-code-ol"><li>'+o.replace(/[\r\t\n]+/g,"</li><li>")+"</li></ol>"),c.find(">.layui-code-h3")[0]||c.prepend('<h3 class="layui-code-h3">'+(c.attr("lay-title")||e.title||"code")+(e.about?'<a href="'+l+'" target="_blank">layui.code</a>':"")+"</h3>");var d=c.find(">.layui-code-ol");c.addClass("layui-box layui-code-view"),(c.attr("lay-skin")||e.skin)&&c.addClass("layui-code-"+(c.attr("lay-skin")||e.skin)),(d.find("li").length/100|0)>0&&d.css("margin-left",(d.find("li").length/100|0)+"px"),(c.attr("lay-height")||e.height)&&d.css("max-height",c.attr("lay-height")||e.height)})})}).addcss("modules/code.css","skincodecss");
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,2 +1,2 @@
|
||||
/** layui-v2.4.5 MIT License By https://www.layui.com */
|
||||
;layui.define("jquery",function(e){"use strict";var l=layui.$,o=function(e){},t='<i class="layui-anim layui-anim-rotate layui-anim-loop layui-icon "></i>';o.prototype.load=function(e){var o,i,n,r,a=this,c=0;e=e||{};var f=l(e.elem);if(f[0]){var m=l(e.scrollElem||document),u=e.mb||50,s=!("isAuto"in e)||e.isAuto,v=e.end||"没有更多了",y=e.scrollElem&&e.scrollElem!==document,d="<cite>加载更多</cite>",h=l('<div class="layui-flow-more"><a href="javascript:;">'+d+"</a></div>");f.find(".layui-flow-more")[0]||f.append(h);var p=function(e,t){e=l(e),h.before(e),t=0==t||null,t?h.html(v):h.find("a").html(d),i=t,o=null,n&&n()},g=function(){o=!0,h.find("a").html(t),"function"==typeof e.done&&e.done(++c,p)};if(g(),h.find("a").on("click",function(){l(this);i||o||g()}),e.isLazyimg)var n=a.lazyimg({elem:e.elem+" img",scrollElem:e.scrollElem});return s?(m.on("scroll",function(){var e=l(this),t=e.scrollTop();r&&clearTimeout(r),i||(r=setTimeout(function(){var i=y?e.height():l(window).height(),n=y?e.prop("scrollHeight"):document.documentElement.scrollHeight;n-t-i<=u&&(o||g())},100))}),a):a}},o.prototype.lazyimg=function(e){var o,t=this,i=0;e=e||{};var n=l(e.scrollElem||document),r=e.elem||"img",a=e.scrollElem&&e.scrollElem!==document,c=function(e,l){var o=n.scrollTop(),r=o+l,c=a?function(){return e.offset().top-n.offset().top+o}():e.offset().top;if(c>=o&&c<=r&&!e.attr("src")){var m=e.attr("lay-src");layui.img(m,function(){var l=t.lazyimg.elem.eq(i);e.attr("src",m).removeAttr("lay-src"),l[0]&&f(l),i++})}},f=function(e,o){var f=a?(o||n).height():l(window).height(),m=n.scrollTop(),u=m+f;if(t.lazyimg.elem=l(r),e)c(e,f);else for(var s=0;s<t.lazyimg.elem.length;s++){var v=t.lazyimg.elem.eq(s),y=a?function(){return v.offset().top-n.offset().top+m}():v.offset().top;if(c(v,f),i=s,y>u)break}};if(f(),!o){var m;n.on("scroll",function(){var e=l(this);m&&clearTimeout(m),m=setTimeout(function(){f(null,e)},50)}),o=!0}return f},e("flow",new o)});
|
||||
/** layui-v2.5.6 MIT License By https://www.layui.com */
|
||||
;layui.define("jquery",function(e){"use strict";var l=layui.$,o=function(e){},t='<i class="layui-anim layui-anim-rotate layui-anim-loop layui-icon "></i>';o.prototype.load=function(e){var o,i,n,r,a=this,c=0;e=e||{};var f=l(e.elem);if(f[0]){var m=l(e.scrollElem||document),u=e.mb||50,s=!("isAuto"in e)||e.isAuto,v=e.end||"没有更多了",y=e.scrollElem&&e.scrollElem!==document,d="<cite>加载更多</cite>",h=l('<div class="layui-flow-more"><a href="javascript:;">'+d+"</a></div>");f.find(".layui-flow-more")[0]||f.append(h);var p=function(e,t){e=l(e),h.before(e),t=0==t||null,t?h.html(v):h.find("a").html(d),i=t,o=null,n&&n()},g=function(){o=!0,h.find("a").html(t),"function"==typeof e.done&&e.done(++c,p)};if(g(),h.find("a").on("click",function(){l(this);i||o||g()}),e.isLazyimg)var n=a.lazyimg({elem:e.elem+" img",scrollElem:e.scrollElem});return s?(m.on("scroll",function(){var e=l(this),t=e.scrollTop();r&&clearTimeout(r),!i&&f.width()&&(r=setTimeout(function(){var i=y?e.height():l(window).height(),n=y?e.prop("scrollHeight"):document.documentElement.scrollHeight;n-t-i<=u&&(o||g())},100))}),a):a}},o.prototype.lazyimg=function(e){var o,t=this,i=0;e=e||{};var n=l(e.scrollElem||document),r=e.elem||"img",a=e.scrollElem&&e.scrollElem!==document,c=function(e,l){var o=n.scrollTop(),r=o+l,c=a?function(){return e.offset().top-n.offset().top+o}():e.offset().top;if(c>=o&&c<=r&&!e.attr("src")){var m=e.attr("lay-src");layui.img(m,function(){var l=t.lazyimg.elem.eq(i);e.attr("src",m).removeAttr("lay-src"),l[0]&&f(l),i++})}},f=function(e,o){var f=a?(o||n).height():l(window).height(),m=n.scrollTop(),u=m+f;if(t.lazyimg.elem=l(r),e)c(e,f);else for(var s=0;s<t.lazyimg.elem.length;s++){var v=t.lazyimg.elem.eq(s),y=a?function(){return v.offset().top-n.offset().top+m}():v.offset().top;if(c(v,f),i=s,y>u)break}};if(f(),!o){var m;n.on("scroll",function(){var e=l(this);m&&clearTimeout(m),m=setTimeout(function(){f(null,e)},50)}),o=!0}return f},e("flow",new o)});
|
File diff suppressed because one or more lines are too long
2
html/static/layui/lay/modules/jquery.js
vendored
2
html/static/layui/lay/modules/jquery.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,2 +1,2 @@
|
||||
/** layui-v2.4.5 MIT License By https://www.layui.com */
|
||||
/** layui-v2.5.6 MIT License By https://www.layui.com */
|
||||
;layui.define(function(e){"use strict";var a=document,t="getElementById",n="getElementsByTagName",i="laypage",r="layui-disabled",u=function(e){var a=this;a.config=e||{},a.config.index=++s.index,a.render(!0)};u.prototype.type=function(){var e=this.config;if("object"==typeof e.elem)return void 0===e.elem.length?2:3},u.prototype.view=function(){var e=this,a=e.config,t=a.groups="groups"in a?0|a.groups:5;a.layout="object"==typeof a.layout?a.layout:["prev","page","next"],a.count=0|a.count,a.curr=0|a.curr||1,a.limits="object"==typeof a.limits?a.limits:[10,20,30,40,50],a.limit=0|a.limit||10,a.pages=Math.ceil(a.count/a.limit)||1,a.curr>a.pages&&(a.curr=a.pages),t<0?t=1:t>a.pages&&(t=a.pages),a.prev="prev"in a?a.prev:"上一页",a.next="next"in a?a.next:"下一页";var n=a.pages>t?Math.ceil((a.curr+(t>1?1:0))/(t>0?t:1)):1,i={prev:function(){return a.prev?'<a href="javascript:;" class="layui-laypage-prev'+(1==a.curr?" "+r:"")+'" data-page="'+(a.curr-1)+'">'+a.prev+"</a>":""}(),page:function(){var e=[];if(a.count<1)return"";n>1&&a.first!==!1&&0!==t&&e.push('<a href="javascript:;" class="layui-laypage-first" data-page="1" title="首页">'+(a.first||1)+"</a>");var i=Math.floor((t-1)/2),r=n>1?a.curr-i:1,u=n>1?function(){var e=a.curr+(t-i-1);return e>a.pages?a.pages:e}():t;for(u-r<t-1&&(r=u-t+1),a.first!==!1&&r>2&&e.push('<span class="layui-laypage-spr">…</span>');r<=u;r++)r===a.curr?e.push('<span class="layui-laypage-curr"><em class="layui-laypage-em" '+(/^#/.test(a.theme)?'style="background-color:'+a.theme+';"':"")+"></em><em>"+r+"</em></span>"):e.push('<a href="javascript:;" data-page="'+r+'">'+r+"</a>");return a.pages>t&&a.pages>u&&a.last!==!1&&(u+1<a.pages&&e.push('<span class="layui-laypage-spr">…</span>'),0!==t&&e.push('<a href="javascript:;" class="layui-laypage-last" title="尾页" data-page="'+a.pages+'">'+(a.last||a.pages)+"</a>")),e.join("")}(),next:function(){return a.next?'<a href="javascript:;" class="layui-laypage-next'+(a.curr==a.pages?" "+r:"")+'" data-page="'+(a.curr+1)+'">'+a.next+"</a>":""}(),count:'<span class="layui-laypage-count">共 '+a.count+" 条</span>",limit:function(){var e=['<span class="layui-laypage-limits"><select lay-ignore>'];return layui.each(a.limits,function(t,n){e.push('<option value="'+n+'"'+(n===a.limit?"selected":"")+">"+n+" 条/页</option>")}),e.join("")+"</select></span>"}(),refresh:['<a href="javascript:;" data-page="'+a.curr+'" class="layui-laypage-refresh">','<i class="layui-icon layui-icon-refresh"></i>',"</a>"].join(""),skip:function(){return['<span class="layui-laypage-skip">到第','<input type="text" min="1" value="'+a.curr+'" class="layui-input">','页<button type="button" class="layui-laypage-btn">确定</button>',"</span>"].join("")}()};return['<div class="layui-box layui-laypage layui-laypage-'+(a.theme?/^#/.test(a.theme)?"molv":a.theme:"default")+'" id="layui-laypage-'+a.index+'">',function(){var e=[];return layui.each(a.layout,function(a,t){i[t]&&e.push(i[t])}),e.join("")}(),"</div>"].join("")},u.prototype.jump=function(e,a){if(e){var t=this,i=t.config,r=e.children,u=e[n]("button")[0],l=e[n]("input")[0],p=e[n]("select")[0],c=function(){var e=0|l.value.replace(/\s|\D/g,"");e&&(i.curr=e,t.render())};if(a)return c();for(var o=0,y=r.length;o<y;o++)"a"===r[o].nodeName.toLowerCase()&&s.on(r[o],"click",function(){var e=0|this.getAttribute("data-page");e<1||e>i.pages||(i.curr=e,t.render())});p&&s.on(p,"change",function(){var e=this.value;i.curr*e>i.count&&(i.curr=Math.ceil(i.count/e)),i.limit=e,t.render()}),u&&s.on(u,"click",function(){c()})}},u.prototype.skip=function(e){if(e){var a=this,t=e[n]("input")[0];t&&s.on(t,"keyup",function(t){var n=this.value,i=t.keyCode;/^(37|38|39|40)$/.test(i)||(/\D/.test(n)&&(this.value=n.replace(/\D/,"")),13===i&&a.jump(e,!0))})}},u.prototype.render=function(e){var n=this,i=n.config,r=n.type(),u=n.view();2===r?i.elem&&(i.elem.innerHTML=u):3===r?i.elem.html(u):a[t](i.elem)&&(a[t](i.elem).innerHTML=u),i.jump&&i.jump(i,e);var s=a[t]("layui-laypage-"+i.index);n.jump(s),i.hash&&!e&&(location.hash="!"+i.hash+"="+i.curr),n.skip(s)};var s={render:function(e){var a=new u(e);return a.index},index:layui.laypage?layui.laypage.index+1e4:0,on:function(e,a,t){return e.attachEvent?e.attachEvent("on"+a,function(a){a.target=a.srcElement,t.call(e,a)}):e.addEventListener(a,t,!1),this}};e(i,s)});
|
@ -1,2 +1,2 @@
|
||||
/** layui-v2.4.5 MIT License By https://www.layui.com */
|
||||
/** layui-v2.5.6 MIT License By https://www.layui.com */
|
||||
;layui.define(function(e){"use strict";var r={open:"{{",close:"}}"},c={exp:function(e){return new RegExp(e,"g")},query:function(e,c,t){var o=["#([\\s\\S])+?","([^{#}])*?"][e||0];return n((c||"")+r.open+o+r.close+(t||""))},escape:function(e){return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""")},error:function(e,r){var c="Laytpl Error:";return"object"==typeof console&&console.error(c+e+"\n"+(r||"")),c+e}},n=c.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=n("^"+r.open+"#",""),l=n(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(n(r.open+"#"),r.open+"# ").replace(n(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(n(r.open+"!(.+?)!"+r.close),function(e){return e=e.replace(n("^"+r.open+"!"),"").replace(n("!"+r.close),"").replace(n(r.open+"|"+r.close),function(e){return e.replace(/(.)/g,"\\$1")})}).replace(/(?="|')/g,"\\").replace(c.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\/g,"")+';view+="'}).replace(c.query(1),function(e){var c='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(n(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),c='"+_escape_('),c+e.replace(/\\/g,"")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,c.escape)}catch(u){return delete o.cache,c.error(u,p)}},t.pt.render=function(e,r){var n,t=this;return e?(n=t.cache?t.cache(e,c.escape):t.parse(t.tpl,e),r?void r(n):n):c.error("no data")};var o=function(e){return"string"!=typeof e?c.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var c in e)r[c]=e[c]},o.v="1.2.0",e("laytpl",o)});
|
File diff suppressed because one or more lines are too long
@ -1,2 +1,2 @@
|
||||
/** layui-v2.4.5 MIT License By https://www.layui.com */
|
||||
/** layui-v2.5.6 MIT License By https://www.layui.com */
|
||||
;layui.define("jquery",function(e){"use strict";var a=layui.jquery,i={config:{},index:layui.rate?layui.rate.index+1e4:0,set:function(e){var i=this;return i.config=a.extend({},i.config,e),i},on:function(e,a){return layui.onevent.call(this,n,e,a)}},l=function(){var e=this,a=e.config;return{setvalue:function(a){e.setvalue.call(e,a)},config:a}},n="rate",t="layui-rate",o="layui-icon-rate",s="layui-icon-rate-solid",u="layui-icon-rate-half",r="layui-icon-rate-solid layui-icon-rate-half",c="layui-icon-rate-solid layui-icon-rate",f="layui-icon-rate layui-icon-rate-half",v=function(e){var l=this;l.index=++i.index,l.config=a.extend({},l.config,i.config,e),l.render()};v.prototype.config={length:5,text:!1,readonly:!1,half:!1,value:0,theme:""},v.prototype.render=function(){var e=this,i=e.config,l=i.theme?'style="color: '+i.theme+';"':"";i.elem=a(i.elem),parseInt(i.value)!==i.value&&(i.half||(i.value=Math.ceil(i.value)-i.value<.5?Math.ceil(i.value):Math.floor(i.value)));for(var n='<ul class="layui-rate" '+(i.readonly?"readonly":"")+">",u=1;u<=i.length;u++){var r='<li class="layui-inline"><i class="layui-icon '+(u>Math.floor(i.value)?o:s)+'" '+l+"></i></li>";i.half&&parseInt(i.value)!==i.value&&u==Math.ceil(i.value)?n=n+'<li><i class="layui-icon layui-icon-rate-half" '+l+"></i></li>":n+=r}n+="</ul>"+(i.text?'<span class="layui-inline">'+i.value+"星":"")+"</span>";var c=i.elem,f=c.next("."+t);f[0]&&f.remove(),e.elemTemp=a(n),i.span=e.elemTemp.next("span"),i.setText&&i.setText(i.value),c.html(e.elemTemp),c.addClass("layui-inline"),i.readonly||e.action()},v.prototype.setvalue=function(e){var a=this,i=a.config;i.value=e,a.render()},v.prototype.action=function(){var e=this,i=e.config,l=e.elemTemp,n=l.find("i").width();l.children("li").each(function(e){var t=e+1,v=a(this);v.on("click",function(e){if(i.value=t,i.half){var o=e.pageX-a(this).offset().left;o<=n/2&&(i.value=i.value-.5)}i.text&&l.next("span").text(i.value+"星"),i.choose&&i.choose(i.value),i.setText&&i.setText(i.value)}),v.on("mousemove",function(e){if(l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+t+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half){var c=e.pageX-a(this).offset().left;c<=n/2&&v.children("i").addClass(u).removeClass(s)}}),v.on("mouseleave",function(){l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+Math.floor(i.value)+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half&&parseInt(i.value)!==i.value&&l.children("li:eq("+Math.floor(i.value)+")").children("i").addClass(u).removeClass(c)})})},v.prototype.events=function(){var e=this;e.config},i.render=function(e){var a=new v(e);return l.call(a)},e(n,i)});
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,2 +1,2 @@
|
||||
/** layui-v2.4.5 MIT License By https://www.layui.com */
|
||||
;layui.define("jquery",function(t){"use strict";var e=layui.$,i={fixbar:function(t){var i,a,n="layui-fixbar",r="layui-fixbar-top",o=e(document),l=e("body");t=e.extend({showHeight:200},t),t.bar1=t.bar1===!0?"":t.bar1,t.bar2=t.bar2===!0?"":t.bar2,t.bgcolor=t.bgcolor?"background-color:"+t.bgcolor:"";var c=[t.bar1,t.bar2,""],g=e(['<ul class="'+n+'">',t.bar1?'<li class="layui-icon" lay-type="bar1" style="'+t.bgcolor+'">'+c[0]+"</li>":"",t.bar2?'<li class="layui-icon" lay-type="bar2" style="'+t.bgcolor+'">'+c[1]+"</li>":"",'<li class="layui-icon '+r+'" lay-type="top" style="'+t.bgcolor+'">'+c[2]+"</li>","</ul>"].join("")),s=g.find("."+r),u=function(){var e=o.scrollTop();e>=t.showHeight?i||(s.show(),i=1):i&&(s.hide(),i=0)};e("."+n)[0]||("object"==typeof t.css&&g.css(t.css),l.append(g),u(),g.find("li").on("click",function(){var i=e(this),a=i.attr("lay-type");"top"===a&&e("html,body").animate({scrollTop:0},200),t.click&&t.click.call(this,a)}),o.on("scroll",function(){clearTimeout(a),a=setTimeout(function(){u()},100)}))},countdown:function(t,e,i){var a=this,n="function"==typeof e,r=new Date(t).getTime(),o=new Date(!e||n?(new Date).getTime():e).getTime(),l=r-o,c=[Math.floor(l/864e5),Math.floor(l/36e5)%24,Math.floor(l/6e4)%60,Math.floor(l/1e3)%60];n&&(i=e);var g=setTimeout(function(){a.countdown(t,o+1e3,i)},1e3);return i&&i(l>0?c:[0,0,0,0],e,g),l<=0&&clearTimeout(g),g},timeAgo:function(t,e){var i=this,a=[[],[]],n=(new Date).getTime()-new Date(t).getTime();return n>6912e5?(n=new Date(t),a[0][0]=i.digit(n.getFullYear(),4),a[0][1]=i.digit(n.getMonth()+1),a[0][2]=i.digit(n.getDate()),e||(a[1][0]=i.digit(n.getHours()),a[1][1]=i.digit(n.getMinutes()),a[1][2]=i.digit(n.getSeconds())),a[0].join("-")+" "+a[1].join(":")):n>=864e5?(n/1e3/60/60/24|0)+"天前":n>=36e5?(n/1e3/60/60|0)+"小时前":n>=12e4?(n/1e3/60|0)+"分钟前":n<0?"未来":"刚刚"},digit:function(t,e){var i="";t=String(t),e=e||2;for(var a=t.length;a<e;a++)i+="0";return t<Math.pow(10,e)?i+(0|t):t},toDateString:function(t,e){var i=this,a=new Date(t||new Date),n=[i.digit(a.getFullYear(),4),i.digit(a.getMonth()+1),i.digit(a.getDate())],r=[i.digit(a.getHours()),i.digit(a.getMinutes()),i.digit(a.getSeconds())];return e=e||"yyyy-MM-dd HH:mm:ss",e.replace(/yyyy/g,n[0]).replace(/MM/g,n[1]).replace(/dd/g,n[2]).replace(/HH/g,r[0]).replace(/mm/g,r[1]).replace(/ss/g,r[2])},escape:function(t){return String(t||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""")}};!function(t,e,i){"$:nomunge";function a(){n=e[l](function(){r.each(function(){var e=t(this),i=e.width(),a=e.height(),n=t.data(this,g);(i!==n.w||a!==n.h)&&e.trigger(c,[n.w=i,n.h=a])}),a()},o[s])}var n,r=t([]),o=t.resize=t.extend(t.resize,{}),l="setTimeout",c="resize",g=c+"-special-event",s="delay",u="throttleWindow";o[s]=250,o[u]=!0,t.event.special[c]={setup:function(){if(!o[u]&&this[l])return!1;var e=t(this);r=r.add(e),t.data(this,g,{w:e.width(),h:e.height()}),1===r.length&&a()},teardown:function(){if(!o[u]&&this[l])return!1;var e=t(this);r=r.not(e),e.removeData(g),r.length||clearTimeout(n)},add:function(e){function a(e,a,r){var o=t(this),l=t.data(this,g)||{};l.w=a!==i?a:o.width(),l.h=r!==i?r:o.height(),n.apply(this,arguments)}if(!o[u]&&this[l])return!1;var n;return t.isFunction(e)?(n=e,a):(n=e.handler,void(e.handler=a))}}}(e,window),t("util",i)});
|
||||
/** layui-v2.5.6 MIT License By https://www.layui.com */
|
||||
;layui.define("jquery",function(e){"use strict";var t=layui.$,i={fixbar:function(e){var i,n,a="layui-fixbar",o="layui-fixbar-top",r=t(document),l=t("body");e=t.extend({showHeight:200},e),e.bar1=e.bar1===!0?"":e.bar1,e.bar2=e.bar2===!0?"":e.bar2,e.bgcolor=e.bgcolor?"background-color:"+e.bgcolor:"";var c=[e.bar1,e.bar2,""],u=t(['<ul class="'+a+'">',e.bar1?'<li class="layui-icon" lay-type="bar1" style="'+e.bgcolor+'">'+c[0]+"</li>":"",e.bar2?'<li class="layui-icon" lay-type="bar2" style="'+e.bgcolor+'">'+c[1]+"</li>":"",'<li class="layui-icon '+o+'" lay-type="top" style="'+e.bgcolor+'">'+c[2]+"</li>","</ul>"].join("")),g=u.find("."+o),s=function(){var t=r.scrollTop();t>=e.showHeight?i||(g.show(),i=1):i&&(g.hide(),i=0)};t("."+a)[0]||("object"==typeof e.css&&u.css(e.css),l.append(u),s(),u.find("li").on("click",function(){var i=t(this),n=i.attr("lay-type");"top"===n&&t("html,body").animate({scrollTop:0},200),e.click&&e.click.call(this,n)}),r.on("scroll",function(){clearTimeout(n),n=setTimeout(function(){s()},100)}))},countdown:function(e,t,i){var n=this,a="function"==typeof t,o=new Date(e).getTime(),r=new Date(!t||a?(new Date).getTime():t).getTime(),l=o-r,c=[Math.floor(l/864e5),Math.floor(l/36e5)%24,Math.floor(l/6e4)%60,Math.floor(l/1e3)%60];a&&(i=t);var u=setTimeout(function(){n.countdown(e,r+1e3,i)},1e3);return i&&i(l>0?c:[0,0,0,0],t,u),l<=0&&clearTimeout(u),u},timeAgo:function(e,t){var i=this,n=[[],[]],a=(new Date).getTime()-new Date(e).getTime();return a>26784e5?(a=new Date(e),n[0][0]=i.digit(a.getFullYear(),4),n[0][1]=i.digit(a.getMonth()+1),n[0][2]=i.digit(a.getDate()),t||(n[1][0]=i.digit(a.getHours()),n[1][1]=i.digit(a.getMinutes()),n[1][2]=i.digit(a.getSeconds())),n[0].join("-")+" "+n[1].join(":")):a>=864e5?(a/1e3/60/60/24|0)+"天前":a>=36e5?(a/1e3/60/60|0)+"小时前":a>=18e4?(a/1e3/60|0)+"分钟前":a<0?"未来":"刚刚"},digit:function(e,t){var i="";e=String(e),t=t||2;for(var n=e.length;n<t;n++)i+="0";return e<Math.pow(10,t)?i+(0|e):e},toDateString:function(e,t){var i=this,n=new Date(e||new Date),a=[i.digit(n.getFullYear(),4),i.digit(n.getMonth()+1),i.digit(n.getDate())],o=[i.digit(n.getHours()),i.digit(n.getMinutes()),i.digit(n.getSeconds())];return t=t||"yyyy-MM-dd HH:mm:ss",t.replace(/yyyy/g,a[0]).replace(/MM/g,a[1]).replace(/dd/g,a[2]).replace(/HH/g,o[0]).replace(/mm/g,o[1]).replace(/ss/g,o[2])},escape:function(e){return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""")},event:function(e,n,a){var o=t("body");return a=a||"click",n=i.event[e]=t.extend(!0,i.event[e],n)||{},i.event.UTIL_EVENT_CALLBACK=i.event.UTIL_EVENT_CALLBACK||{},o.off(a,"*["+e+"]",i.event.UTIL_EVENT_CALLBACK[e]),i.event.UTIL_EVENT_CALLBACK[e]=function(){var i=t(this),a=i.attr(e);"function"==typeof n[a]&&n[a].call(this,i)},o.on(a,"*["+e+"]",i.event.UTIL_EVENT_CALLBACK[e]),n}};!function(e,t,i){"$:nomunge";function n(){a=t[l](function(){o.each(function(){var t=e(this),i=t.width(),n=t.height(),a=e.data(this,u);(i!==a.w||n!==a.h)&&t.trigger(c,[a.w=i,a.h=n])}),n()},r[g])}var a,o=e([]),r=e.resize=e.extend(e.resize,{}),l="setTimeout",c="resize",u=c+"-special-event",g="delay",s="throttleWindow";r[g]=250,r[s]=!0,e.event.special[c]={setup:function(){if(!r[s]&&this[l])return!1;var t=e(this);o=o.add(t),e.data(this,u,{w:t.width(),h:t.height()}),1===o.length&&n()},teardown:function(){if(!r[s]&&this[l])return!1;var t=e(this);o=o.not(t),t.removeData(u),o.length||clearTimeout(a)},add:function(t){function n(t,n,o){var r=e(this),l=e.data(this,u)||{};l.w=n!==i?n:r.width(),l.h=o!==i?o:r.height(),a.apply(this,arguments)}if(!r[s]&&this[l])return!1;var a;return e.isFunction(t)?(a=t,n):(a=t.handler,void(t.handler=n))}}}(t,window),e("util",i)});
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -4,6 +4,9 @@ import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.yutou.enums.UserEnum;
|
||||
import com.yutou.services.MagicBoxService;
|
||||
import org.json.JSONObject;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
@ -15,13 +18,20 @@ import com.yutou.services.UserService;
|
||||
import com.yutou.utlis.RedisUtlis;
|
||||
import com.yutou.utlis.Tools;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.TimeZone;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/admin")
|
||||
@RequestMapping("/admin/magicbox")
|
||||
public class AdminMagicBoxController {
|
||||
@Resource
|
||||
UserService userService;
|
||||
@Resource
|
||||
PermissionService powerService;
|
||||
@Resource
|
||||
MagicBoxService magicBoxService;
|
||||
|
||||
@RequestMapping("/data.do")
|
||||
@ResponseBody
|
||||
@ -32,11 +42,68 @@ public class AdminMagicBoxController {
|
||||
} else if (!isAdmin(request)) {
|
||||
return "404 not fount";
|
||||
} else {
|
||||
tmp = RedisUtlis.set(data, set,0) + "";
|
||||
tmp = RedisUtlis.set(data, set,-1) + "";
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
@RequestMapping("/activity.do")
|
||||
@ResponseBody
|
||||
public String setActivityTime(HttpServletRequest request,String title,String url,String start,String end){
|
||||
JSONObject json=new JSONObject();
|
||||
if(!isAdmin(request)){
|
||||
json.put("data", UserEnum.LOGIN_NOT_LOGIN.code);
|
||||
json.put("msg",UserEnum.LOGIN_NOT_LOGIN.msg);
|
||||
return json.toString();
|
||||
}
|
||||
try {
|
||||
SimpleDateFormat startDate=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
SimpleDateFormat entDate=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
startDate.setTimeZone(TimeZone.getTimeZone("GMT+8:00"));
|
||||
entDate.setTimeZone(TimeZone.getTimeZone("GMT+8:00"));
|
||||
int ret=magicBoxService.setActivityTime(title,url,startDate.parse(start),entDate.parse(end));
|
||||
if(ret==1){
|
||||
json.put("data",0);
|
||||
json.put("msg","提交成功");
|
||||
}else{
|
||||
json.put("data",-1);
|
||||
json.put("msg","提交失败");
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
json.put("data",-1);
|
||||
json.put("msg","时间异常");
|
||||
}
|
||||
|
||||
return json.toString();
|
||||
|
||||
}
|
||||
@RequestMapping("/banner.do")
|
||||
@ResponseBody
|
||||
public String setBanner(HttpServletRequest request,int id,String url,String click,String state){
|
||||
JSONObject json=new JSONObject();
|
||||
if(!isAdmin(request)){
|
||||
json.put("data", UserEnum.LOGIN_NOT_LOGIN.code);
|
||||
json.put("msg",UserEnum.LOGIN_NOT_LOGIN.msg);
|
||||
return json.toString();
|
||||
}
|
||||
int _state=-999;
|
||||
try {
|
||||
_state=Integer.parseInt(state);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
int ret=magicBoxService.setBanner(id,url,click,_state);
|
||||
if(ret==1){
|
||||
json.put("data",0);
|
||||
json.put("msg","提交成功");
|
||||
}else{
|
||||
json.put("data",-1);
|
||||
json.put("msg","提交失败");
|
||||
}
|
||||
return json.toString();
|
||||
}
|
||||
|
||||
public boolean isAdmin(HttpServletRequest request) {
|
||||
try {
|
||||
int uid = Tools.getUserId(request);
|
||||
|
@ -50,6 +50,9 @@ public class SystemController {
|
||||
public String addFeedBack(HttpServletRequest request) {
|
||||
JSONObject json=new JSONObject();
|
||||
int uid_ = Tools.getUidOfToken(request);
|
||||
if(uid_==0){
|
||||
uid_=Tools.getUserId(request);
|
||||
}
|
||||
if (uid_ == 0) {
|
||||
json.put("code", UserEnum.LOGIN_NOT_LOGIN.code);
|
||||
json.put("msg", UserEnum.LOGIN_NOT_LOGIN.msg);
|
||||
@ -60,7 +63,7 @@ public class SystemController {
|
||||
String sysinfo=request.getParameter("sysinfo");
|
||||
int _uid=0;
|
||||
try {
|
||||
_uid=Integer.valueOf(uid);
|
||||
_uid=Integer.parseInt(uid);
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
}
|
||||
@ -72,7 +75,7 @@ public class SystemController {
|
||||
json.put("code", 100);
|
||||
json.put("msg", systemService.addFeedBack(_uid, context, sysinfo)==1?"提交成功":"提交失败");
|
||||
UUserdata udata=user.getUUserData(Integer.parseInt(uid));
|
||||
Tools.getHTTPUrlString("https://sc.ftqq.com/SCU64034T5adf5c5940dcecc016e0e9d0cf9b1e725da126ff47475.send?text=盒子问题反馈&desp="+"来自uid:"+uid+"的问题反馈\n"+context+"\n系统信息:"+sysinfo+"\n对方邮箱:"+udata.getEmail());
|
||||
Tools.getHTTPUrlString("https://sc.ftqq.com/SCU64034T5adf5c5940dcecc016e0e9d0cf9b1e725da126ff47475.send?text=盒子问题反馈&desp="+"来自uid:"+uid+"的问题反馈"+context+",系统信息:"+sysinfo+",对方邮箱:"+udata.getEmail());
|
||||
try {
|
||||
EmailTools.send("583819556@qq.com", "盒子问题反馈", "来自uid:"+uid+"的问题反馈\n"+context+"\n系统信息:"+sysinfo+"\n对方邮箱:"+udata.getEmail());
|
||||
} catch (Exception e) {
|
||||
|
@ -39,7 +39,7 @@ public class MapNodeService {
|
||||
if(tmp==null){
|
||||
list=dao.selectNodeByMid("%"+nodeId+"%", limit, count);
|
||||
tmp=JSONArray.toJSONString(list);
|
||||
RedisUtlis.set(nodeId+"",tmp);
|
||||
RedisUtlis.set(nodeId+"",tmp,-1);
|
||||
}else{
|
||||
list= JSONArray.parseArray(tmp,GameInfoLog.class);
|
||||
new Thread(new Runnable() {
|
||||
@ -47,7 +47,7 @@ public class MapNodeService {
|
||||
public void run() {
|
||||
List<GameInfoLog> tmpList=dao.selectNodeByMid("%"+nodeId+"%", limit, count);
|
||||
String tmp=JSONArray.toJSONString(tmpList);
|
||||
RedisUtlis.set(nodeId+"",tmp);
|
||||
RedisUtlis.set(nodeId+"",tmp,-1);
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
8
src/main/java/com/yutou/services/MagicBoxService.java
Normal file
8
src/main/java/com/yutou/services/MagicBoxService.java
Normal file
@ -0,0 +1,8 @@
|
||||
package com.yutou.services;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public interface MagicBoxService {
|
||||
int setActivityTime(String title, String url, Date start,Date end);
|
||||
int setBanner(int id,String url,String click,int state);
|
||||
}
|
@ -30,7 +30,7 @@ import com.yutou.services.AppConfig;
|
||||
import com.yutou.utlis.ListComparator;
|
||||
|
||||
@Service("appConfig")
|
||||
public class AppConfigServiceImpi implements AppConfig {
|
||||
public class AppConfigServiceImpl implements AppConfig {
|
||||
@Resource
|
||||
SConfigMapper configMapper;
|
||||
@Resource
|
@ -0,0 +1,44 @@
|
||||
package com.yutou.services.impl;
|
||||
|
||||
import com.yutou.mybatis.MAppHomeConfig;
|
||||
import com.yutou.mybatis.MBanner;
|
||||
import com.yutou.mybatis.dao.MAppHomeConfigMapper;
|
||||
import com.yutou.mybatis.dao.MBannerMapper;
|
||||
import com.yutou.services.MagicBoxService;
|
||||
import com.yutou.utlis.Tools;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
|
||||
@Service("magicBoxService")
|
||||
public class MagicBoxServiceImpl implements MagicBoxService {
|
||||
@Resource
|
||||
MAppHomeConfigMapper appHomeConfigMapper;
|
||||
@Resource
|
||||
MBannerMapper bannerMapper;
|
||||
@Override
|
||||
public int setActivityTime(String title, String url, Date start, Date end) {
|
||||
MAppHomeConfig config=new MAppHomeConfig();
|
||||
config.setName(title);
|
||||
config.setUrl(url);
|
||||
config.setStartdate(start);
|
||||
config.setEnddate(end);
|
||||
config.setState(1);
|
||||
config.setId(1);
|
||||
return appHomeConfigMapper.updateByPrimaryKey(config);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int setBanner(int id, String url, String click, int state) {
|
||||
MBanner banner=new MBanner();
|
||||
banner.setId(id);
|
||||
if(!Tools.StringIsEmpty(url))
|
||||
banner.setUrl(url);
|
||||
if(!Tools.StringIsEmpty(click))
|
||||
banner.setClick(click);
|
||||
if(state!=-999)
|
||||
banner.setIsshow(state);
|
||||
return bannerMapper.updateByPrimaryKey(banner);
|
||||
}
|
||||
}
|
@ -40,7 +40,11 @@ public class RedisUtlis {
|
||||
public static boolean set(String key,String value,int timeout) {
|
||||
try {
|
||||
Jedis jedis=getRedis();
|
||||
jedis.setex(key, timeout, value);
|
||||
if(timeout==-1){
|
||||
jedis.set(key,value);
|
||||
}else {
|
||||
jedis.setex(key, timeout, value);
|
||||
}
|
||||
jedis.close();
|
||||
}catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
|
Reference in New Issue
Block a user