调整魔目录结构

This commit is contained in:
zhengxinonly
2021-06-24 02:42:34 +08:00
parent 0cb74c5eb7
commit 8fba71c464
26 changed files with 294 additions and 289 deletions
@@ -12,14 +12,14 @@
<div class="layui-tab layui-tab-card">
<ul class="layui-tab-title">
<li class="layui-this">登录日志</li>
<li>操作日志</li>
<li>访问日志</li>
</ul>
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">
<table style="margin-top: 10px;" id="log-login-table" lay-filter="log-login-table"></table>
</div>
<div class="layui-tab-item">
<table style="margin-top: 10px;" id="log-operate-table" lay-filter="log-operate-table"></table>
<table style="margin-top: 10px;" id="log-access-table" lay-filter="log-access-table"></table>
</div>
</div>
</div>
@@ -44,7 +44,7 @@
let table = layui.table
let form = layui.form
let MODULE_PATH = '/admin/log/'
let MODULE_PATH = '/logs/'
let cols = [
[
@@ -61,8 +61,8 @@
]
table.render({
elem: '#log-operate-table',
url: MODULE_PATH + 'operateLog',
elem: '#log-access-table',
url: MODULE_PATH + 'access_log',
page: true,
cols: cols,
skin: 'line',
@@ -71,7 +71,7 @@
table.render({
elem: '#log-login-table',
url: MODULE_PATH + 'loginLog',
url: MODULE_PATH + 'login_log',
page: true,
cols: cols,
skin: 'line',
+2 -1
View File
@@ -97,6 +97,7 @@
let form = layui.form
let $ = layui.jquery
// 当点击更新之后,获取数据
form.on('submit(dept-update)', function (data) {
$.ajax({
url: '/dept/update',
@@ -107,7 +108,7 @@
success: function (result) {
if (result.success) {
layer.msg(result.msg, { icon: 1, time: 1000 }, function () {
parent.layer.close(parent.layer.getFrameIndex(window.name))//关闭当前页
parent.layer.close(parent.layer.getFrameIndex(window.name)) //关闭当前页
parent.render()
})
} else {
+4 -1
View File
@@ -163,13 +163,16 @@
/*表格的工具栏*/
table.on('toolbar(dept-table)', function (obj) {
console.log(obj)
if (obj.event === 'add') {
window.add()
} else if (obj.event === 'refresh') {
window.refresh()
} else if (obj.event === 'batchRemove') {
{#window.batchRemove(obj)#}
console.log(table.checkStatus(obj.config.id).data)
layer.msg('禁止批量删除')
return false
{#console.log(table.checkStatus(obj.config.id).data)#}
}
})
+1 -1
View File
@@ -69,7 +69,7 @@
success: function (result) {
if (result.success) {
layer.msg(result.msg, { icon: 1, time: 1000 }, function () {
parent.layer.close(parent.layer.getFrameIndex(window.name))//关闭当前页
parent.layer.close(parent.layer.getFrameIndex(window.name)) //关闭当前页
parent.layui.table.reload('dict-type-table')
})
} else {
+7 -3
View File
@@ -92,7 +92,9 @@
</script>
<script type="text/html" id="dict-type-enable">
<input type="checkbox" value="{{ "{{ d.id }}" }}" lay-skin="switch" lay-text="启用|禁用" lay-filter="dict-type-enable"
<input type="checkbox" value="{{ "{{ d.id }}" }}"
lay-skin="switch" lay-text="启用|禁用"
lay-filter="dict-type-enable"
{{ "{{# if(d.enable==1){ }} checked {{# } }}" }}>
</script>
@@ -108,9 +110,11 @@
</script>
<script type="text/html" id="dict-data-bar">
<button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>
<button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="edit">
<i class="layui-icon layui-icon-edit"></i>
</button>
<button class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove"><i class="layui-icon layui-icon-delete"></i>
<button class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove">
<i class="layui-icon layui-icon-delete"></i>
</button>
</script>
@@ -210,7 +210,7 @@
layer.close(index)
let loading = layer.load()
$.ajax({
url: "{{ url_for('adminFile.batch_remove') }}",
url: "{{ url_for('file.batch_remove') }}",
data: { ids: ids },
dataType: 'json',
type: 'POST',
@@ -43,7 +43,7 @@
//选完文件后不自动上传
upload.render({
elem: '#logo-img'
, url: "{{ url_for('adminFile.upload') }}"
, url: "{{ url_for('file.upload') }}"
, auto: false
, exts: 'jpg|png|gif|bmp|jpeg'
, size: 1000
+9 -4
View File
@@ -17,9 +17,12 @@
<div class="layui-header">
<!-- 顶 部 左 侧 功 能 -->
<ul class="layui-nav layui-layout-left">
<li class="collaspe layui-nav-item"><a href="#" class="layui-icon layui-icon-shrink-right"></a></li>
<li class="refresh layui-nav-item"><a href="#" class="layui-icon layui-icon-refresh-1" title="刷新页面"
loading=600></a></li>
<li class="collaspe layui-nav-item">
<a href="#" class="layui-icon layui-icon-shrink-right"></a>
</li>
<li class="refresh layui-nav-item">
<a href="#" class="layui-icon layui-icon-refresh-1" title="刷新页面" loading=600></a>
</li>
</ul>
<!-- 顶 部 右 侧 菜 单 -->
<div id="control" class="layui-layout-control"></div>
@@ -66,7 +69,9 @@
<!-- 遮 盖 层 -->
<div class="pear-cover"></div>
<!-- 移 动 端 便 捷 操 作 -->
<div class="pear-collasped-pe collaspe"><a href="#" class="layui-icon layui-icon-shrink-right"></a></div>
<div class="pear-collasped-pe collaspe">
<a href="#" class="layui-icon layui-icon-shrink-right"></a>
</div>
<!-- 加 载 动 画-->
<div class="loader-main">
<div class="loader"></div>
+46 -41
View File
@@ -39,51 +39,56 @@
</form>
{% include 'admin/common/footer.html' %}
<script>
layui.use(['form', 'jquery', 'layer', 'button', 'popup'], function () {
let form = layui.form;
let $ = layui.jquery;
let layer = layui.layer;
let button = layui.button;
let popup = layui.popup;
let captchaPath = "{{ url_for('passport.get_captcha') }}";
layui.use(['form', 'jquery', 'layer', 'button', 'popup'], function () {
let form = layui.form
let $ = layui.jquery
let layer = layui.layer
let button = layui.button
let popup = layui.popup
let captchaPath = "{{ url_for('passport.get_captcha') }}"
form.on('submit(login)', function (data) {
let loader = layer.load();
let btn = button.load({elem: '.login'});
$.ajax({
data: data.field,
type: "post",
dataType: 'json',
success: function (result) {
layer.close(loader);
btn.stop(function () {
if (result.success) {
popup.success(result.msg, function () {
location.href = "{{ url_for('admin.index') }}";
})
} else {
popup.failure(result.msg, function () {
document.getElementById("captchaImage").src = captchaPath + "?" + Math.random();
});
}
})
}
});
return false;
});
$("#captchaImage").click(function () {
document.getElementById("captchaImage").src = captchaPath + "?" + Math.random();
});
setInterval(function () {
document.getElementById("captchaImage").src = captchaPath + "?" + Math.random();
}, 30 * 1000);
form.on('submit(login)', function (data) {
// data 是表单的数据
let loader = layer.load() // 加载按钮
let btn = button.load({ elem: '.login' })
$.ajax({
data: data.field,
type: 'post',
dataType: 'json',
// 请求成功之后返回的数据
success: function (result) {
layer.close(loader) // 关闭加载按钮
btn.stop(function () {
if (result.success) {
popup.success(result.msg, function () {
location.href = "{{ url_for('admin.index') }}"
})
} else {
popup.failure(result.msg, function () {
document.getElementById('captchaImage').src = captchaPath + '?' + Math.random()
})
}
})
}
})
return false
})
// 点击按钮更新验证码
$('#captchaImage').click(function () {
document.getElementById('captchaImage').src = captchaPath + '?' + Math.random()
})
// 定时器,定时更新验证码
setInterval(function () {
document.getElementById('captchaImage').src = captchaPath + '?' + Math.random()
}, 30 * 1000)
})
</script>
<script>
if (window !== top) {
top.location.href = location.href;
}
if (window !== top) {
top.location.href = location.href
}
</script>
</body>
</html>
+2 -1
View File
@@ -137,8 +137,9 @@
form.on('submit(power-save)', function (data) {
data.field.icon = 'layui-icon ' + data.field.icon
console.log(data.field)
$.ajax({
url: '{{ url_for('rights.update') }}',
url: '/rights/power/' + data.field.powerId ,
data: JSON.stringify(data.field),
dataType: 'json',
contentType: 'application/json',
+3 -3
View File
@@ -106,7 +106,7 @@
toolbar: '#power-toolbar',
elem: '#power-table',
url: '{{ url_for('rights.data') }}',
page: false,
page: false,
cols: [
[
{% if authorize("admin:role:remove") %}
@@ -212,7 +212,7 @@
title: '修改',
shade: 0.1,
area: ['450px', '500px'],
content: MODULE_PATH + 'edit/' + obj.data['powerId']
content: MODULE_PATH + 'power/' + obj.data['powerId']
})
}
window.remove = function (obj) {
@@ -220,7 +220,7 @@
layer.close(index)
let loading = layer.load()
$.ajax({
url: MODULE_PATH + 'remove/' + obj.data['powerId'],
url: MODULE_PATH + 'power/' + obj.data['powerId'],
dataType: 'json',
type: 'delete',
success: function (result) {