提交 eb4f28ae 编写于 作者: lakernote's avatar lakernote

(bugfix)[整体](行为日志修改显示异常的判断)

上级 0d74da55
......@@ -3,8 +3,6 @@ package com.laker.admin.framework.aop;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.useragent.UserAgent;
import cn.hutool.json.JSON;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.laker.admin.module.ext.entity.ExtLog;
......@@ -83,8 +81,7 @@ public class MetricsAspect {
if (StrUtil.isNotBlank(response) && response.length() <= 500) {
logBean.setResponse(response);
}
JSON json = JSONUtil.parse(response);
if (json instanceof JSONObject) {
if (JSONUtil.isJsonObj(response)) {
Boolean success = JSONUtil.parseObj(response).getBool("success", true);
logBean.setStatus(success);
}
......
......@@ -2,6 +2,7 @@ package com.laker.admin.module.sys.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
......@@ -169,4 +170,12 @@ public class SysUserController {
return Response.ok(allRole);
}
@DeleteMapping("/batch/{ids}")
@ApiOperation(value = "根据批量删除ids删除")
@SaCheckPermission("dict.delete")
public Response batchRemove(@PathVariable Long[] ids) {
return Response.ok(sysUserService.removeByIds(CollUtil.toList(ids)));
}
}
\ No newline at end of file
......@@ -216,8 +216,7 @@ layui.define(['jquery', 'element', 'form', 'table', 'yaml', 'common'], function
layer.msg(result.msg, {
icon: 2,
time: 1000,
area: ['100px', '65px'],
content: "删除失败"
area: ['260px', '65px']
});
}
}
......@@ -313,7 +312,7 @@ layui.define(['jquery', 'element', 'form', 'table', 'yaml', 'common'], function
} else {
layer.msg(result.msg, {
icon: 2,
area: ['100px', '65px'],
area: ['260px', '65px'],
time: 1000
});
}
......
......@@ -72,9 +72,7 @@
let easyAdmin = layui.easyAdmin;
let cols = [
[{
type: 'checkbox'
},
[
{
title: '用户',
field: 'user.nickName',
......@@ -141,7 +139,7 @@
title: '访问状态',
field: 'status',
align: 'center',
width: 60,
width: 80,
templet: '#log-bar'
}
]
......
......@@ -36,22 +36,10 @@
</div>
</div>
<!--<script type="text/html" id="user-toolbar">-->
<!-- <button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">-->
<!-- <i class="layui-icon layui-icon-add-1"></i>-->
<!-- 新增-->
<!-- </button>-->
<!-- <button class="pear-btn pear-btn-danger pear-btn-md" lay-event="batchRemove">-->
<!-- <i class="layui-icon layui-icon-delete"></i>-->
<!-- 删除-->
<!-- </button>-->
<!--</script>-->
<script type="text/html" id="user-bar">
<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>-->
</script>
......@@ -77,9 +65,7 @@
let common = layui.common;
let easyAdmin = layui.easyAdmin;
let cols = [
[{
type: 'checkbox'
},
[
{
title: '流程实例编号',
field: 'orderNo',
......
......@@ -160,7 +160,7 @@
if (result.success) {
layer.msg("操作成功", {icon: 1, time: 1000, area: ['100px', '65px']});
} else {
layer.msg(result.msg, {icon: 2, time: 1000, area: ['100px', '65px']});
layer.msg(result.msg, {icon: 2, time: 1000, area: ['260px', '65px']});
}
}
})
......
......@@ -17,10 +17,6 @@
<i class="layui-icon layui-icon-add-1"></i>
新增
</button>
<button class="pear-btn pear-btn-danger pear-btn-md" lay-event="batchRemove">
<i class="layui-icon layui-icon-delete"></i>
删除
</button>
<button class="pear-btn pear-btn-success pear-btn-md" lay-event="expandAll">
<i class="layui-icon layui-icon-spread-left"></i>
展开
......@@ -85,7 +81,6 @@
page: false,
cols: [
[
{type: 'checkbox'},
{field: 'title', minWidth: 200, title: '菜单名称'},
{field: 'icon', title: '图标', templet: '#icon'},
{field: 'type', title: '权限类型', templet: '#power-type'},
......@@ -138,7 +133,7 @@
if (result.success) {
layer.msg("操作成功", {icon: 1, time: 1000, area: ['100px', '65px']});
} else {
layer.msg(result.msg, {icon: 2, time: 1000, area: ['100px', '65px']});
layer.msg(result.msg, {icon: 2, time: 1000, area: ['260px', '65px']});
}
}
})
......@@ -185,50 +180,6 @@
})
});
}
window.batchRemove = function (obj) {
let data = table.checkStatus(obj.config.id).data;
if (data.length === 0) {
layer.msg("未选中数据", {
icon: 3,
time: 1000
});
return false;
}
let ids = "";
for (let i = 0; i < data.length; i++) {
ids += data[i].powerId + ",";
}
ids = ids.substr(0, ids.length - 1);
layer.confirm('确定要删除这些权限', {
icon: 3,
title: '提示'
}, function (index) {
layer.close(index);
let loading = layer.load();
$.ajax({
url: MODULE_PATH + "batchRemove/" + ids,
dataType: 'json',
type: 'delete',
success: function (result) {
layer.close(loading);
if (result.success) {
layer.msg(result.msg, {
icon: 1,
time: 1000
}, function () {
table.reload('user-table');
});
} else {
layer.msg(result.msg, {
icon: 2,
time: 1000
});
}
}
})
});
}
})
</script>
</body>
......
......@@ -60,9 +60,7 @@
let easyAdmin = layui.easyAdmin;
let table = layui.table;
let cols = [
[{
type: 'checkbox'
},
[
{
title: '任务的编码',
field: 'taskCode',
......
......@@ -239,7 +239,8 @@
if (result.success) {
layer.msg("操作成功", {icon: 1, time: 1000, area: ['100px', '65px']});
} else {
layer.msg(result.msg, {icon: 2, time: 1000, area: ['100px', '65px']});
layer.msg(result.msg, {icon: 2, time: 1000, area: ['260px', '80px']});
table.reload('user-table');
}
}
})
......@@ -301,8 +302,7 @@
layer.msg(result.msg, {
icon: 2,
time: 1000,
area: ['100px', '60px'],
content: "删除失败"
area: ['260px', '80px']
});
}
}
......@@ -329,7 +329,7 @@
layer.close(index);
let loading = layer.load();
easyAdmin.http({
url: MODULE_PATH + "batchRemove/" + ids,
url: "/sys/user/batch/" + checkIds,
dataType: 'json',
type: 'delete',
success: function (result) {
......@@ -344,6 +344,7 @@
} else {
layer.msg(result.msg, {
icon: 2,
area: ['260px', '80px'],
time: 1000
});
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册