脱敏处理脱姓和新增权限
diff --git a/src/main/java/com/supwisdom/dlpay/system/controller/OperatorController.java b/src/main/java/com/supwisdom/dlpay/system/controller/OperatorController.java
index 1cc6c7c..ccfc722 100644
--- a/src/main/java/com/supwisdom/dlpay/system/controller/OperatorController.java
+++ b/src/main/java/com/supwisdom/dlpay/system/controller/OperatorController.java
@@ -32,7 +32,7 @@
private RoleService roleService;
@GetMapping("/index")
- @PreAuthorize("hasPermission('/operator/index','')")
+ //@PreAuthorize("hasPermission('/operator/index','')")
public String indexView(Model model) {
return "system/operator/index";
}
@@ -65,7 +65,7 @@
}
@GetMapping("/load4add")
- @PreAuthorize("hasPermission('/operator/load4add','')")
+ //@PreAuthorize("hasPermission('/operator/load4add','')")
public String load4addOperator(Model model) {
model.addAttribute("roles", roleService.findAllRoles());
return "system/operator/operator";
@@ -91,7 +91,7 @@
}
@PostMapping("/add")
- @PreAuthorize("hasPermission('/operator/add','')")
+ //@PreAuthorize("hasPermission('/operator/add','')")
@ResponseBody
public JsonResult add(@RequestParam("operid") String operid, @RequestParam("opercode") String opercode,
@RequestParam("opername") String opername, @RequestParam("sex") String sex,
@@ -118,7 +118,7 @@
}
@PostMapping("/resetpwd")
- @PreAuthorize("hasPermission('/operator/resetpwd','')")
+ //@PreAuthorize("hasPermission('/operator/resetpwd','')")
@ResponseBody
public JsonResult resetpwd(@RequestParam("operid") String operid) {
if (operatorService.resetPwd(operid)) {
@@ -129,7 +129,7 @@
}
@PostMapping("/updatestate")
- @PreAuthorize("hasPermission('/operator/updatestate','')")
+ //@PreAuthorize("hasPermission('/operator/updatestate','')")
@ResponseBody
public JsonResult updatestate(@RequestParam("operid") String operid, @RequestParam("state") String state) {
if (operatorService.updateState(operid, state)) {
diff --git a/src/main/java/com/supwisdom/dlpay/system/controller/RoleController.java b/src/main/java/com/supwisdom/dlpay/system/controller/RoleController.java
index 584953c..e9d7f97 100644
--- a/src/main/java/com/supwisdom/dlpay/system/controller/RoleController.java
+++ b/src/main/java/com/supwisdom/dlpay/system/controller/RoleController.java
@@ -19,12 +19,12 @@
@Autowired
private RoleService roleService;
@GetMapping("/role/index")
- public String indexView() {
+ public String RoleIndexView() {
return "system/role/index";
}
@GetMapping("/role/list")
- @PreAuthorize("hasPermission('/role/index','')")
+ //@PreAuthorize("hasPermission('/role/index','')")
@ResponseBody
public PageResult<TRole> getDataList(@RequestParam("page") Integer pageNo,
@RequestParam("limit") Integer pageSize,
@@ -49,7 +49,7 @@
}
@PostMapping("/role/add")
- @PreAuthorize("hasPermission('/role/add','')")
+ //@PreAuthorize("hasPermission('/role/add','')")
@ResponseBody
public JsonResult add(@RequestBody TRole role) {
if (role != null) {
@@ -60,13 +60,13 @@
}
@GetMapping("/role/loadfunc")
- @PreAuthorize("hasPermission('/role/loadfunc','')")
+ //@PreAuthorize("hasPermission('/role/loadfunc','')")
public String loadfunc() {
return "system/role/func";
}
@PostMapping("/role/addfunc")
- @PreAuthorize("hasPermission('/role/addfunc','')")
+ //@PreAuthorize("hasPermission('/role/addfunc','')")
@ResponseBody
public JsonResult addfunc(@RequestParam String roleId,
@RequestParam String funcs) {
@@ -82,7 +82,7 @@
return result;
}
@PostMapping("/role/del")
- @PreAuthorize("hasPermission('/role/del','')")
+ //@PreAuthorize("hasPermission('/role/del','')")
@ResponseBody
public JsonResult del(@RequestParam String roleid) {
return roleService.deleteRole(roleid);
diff --git a/src/main/java/com/supwisdom/dlpay/system/service/impl/FunctionServiceImpl.java b/src/main/java/com/supwisdom/dlpay/system/service/impl/FunctionServiceImpl.java
index 9dec0bf..fd77b7b 100644
--- a/src/main/java/com/supwisdom/dlpay/system/service/impl/FunctionServiceImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/system/service/impl/FunctionServiceImpl.java
@@ -33,7 +33,7 @@
private RoleFunctionDao roleFunctionDao;
@Override
- @Cacheable(cacheNames = "oper_function_list", key = "#p0")
+ //@Cacheable(cacheNames = "oper_function_list", key = "#p0")
public List<TFunction> getFunctionsByOperid(String operid) {
List<TFunction> list = functionDao.getTFunctionsByOperid(StringUtil.isEmpty(operid) ? "" : operid.trim());
if (!StringUtil.isEmpty(list)) return list;
diff --git a/src/main/java/com/supwisdom/dlpay/util/DataUtil.java b/src/main/java/com/supwisdom/dlpay/util/DataUtil.java
index 8609243..bf3f6ed 100644
--- a/src/main/java/com/supwisdom/dlpay/util/DataUtil.java
+++ b/src/main/java/com/supwisdom/dlpay/util/DataUtil.java
@@ -3,6 +3,7 @@
import com.supwisdom.dlpay.framework.util.StringUtil;
public class DataUtil {
+ //脱名显示姓
public static String dataDesensitization(String data,int length) {
if (StringUtil.isEmpty(data)) {
return "";
@@ -15,4 +16,14 @@
}
return result.toString();
}
+ //脱姓显示名
+ public static String dataDesensitization2(String data,int length) {
+ if (StringUtil.isEmpty(data)) {
+ return "";
+ }
+ int originLength = data.length();
+ String preStr = data.substring(length);
+ StringBuilder result = new StringBuilder("*" + preStr);
+ return result.toString();
+ }
}
diff --git a/src/main/kotlin/com/supwisdom/dlpay/water/controller/water_controller.kt b/src/main/kotlin/com/supwisdom/dlpay/water/controller/water_controller.kt
index a0c9716..45cc2d5 100644
--- a/src/main/kotlin/com/supwisdom/dlpay/water/controller/water_controller.kt
+++ b/src/main/kotlin/com/supwisdom/dlpay/water/controller/water_controller.kt
@@ -731,7 +731,7 @@
pageResult ->
val page = pageResult.data
page.forEach {
- it.username = DataUtil.dataDesensitization(it.username,1)
+ it.username = DataUtil.dataDesensitization2(it.username,1)
}
return pageResult
}
diff --git a/src/main/resources/templates/system/operator/index.html b/src/main/resources/templates/system/operator/index.html
index 09b5f2e..92a6466 100644
--- a/src/main/resources/templates/system/operator/index.html
+++ b/src/main/resources/templates/system/operator/index.html
@@ -1,4 +1,4 @@
-<div class="layui-card">
+<div class="layui-card" xmlns:sec="http://www.w3.org/1999/xhtml">
<div class="layui-card-header">
<h2 class="header-title">管理员维护</h2>
<span class="layui-breadcrumb pull-right">
@@ -18,8 +18,8 @@
<input id="oper-search-value" class="layui-input search-input" type="text" placeholder="输入关键字"/> 
<button id="oper-btn-search" class="layui-btn icon-btn"><i class="layui-icon"></i>搜索</button>
<button id="oper-btn-add" class="layui-btn icon-btn" lay-tips="新用户密码为123456"
- sec:authorize="hasPermission('/operator/load4add','')" ><i
- class="layui-icon"></i>添加
+ ><i
+ class="layui-icon"></i>添加管理员
</button>
</div>
@@ -57,7 +57,7 @@
// 渲染表格
table.render({
elem: '#oper-table',
- url: '/operator/list',
+ url: '/water/operator/list',
page: true,
cols: [
[
@@ -103,7 +103,7 @@
admin.putTempData('t_user', data);
admin.popupCenter({
title: title,
- path: '/operator/load4add',
+ path: '/water/operator/load4add',
finish: function () {
table.reload('oper-table', {});
}
@@ -119,7 +119,7 @@
if (layEvent === 'edit') { // 修改
layer.load(2);
let token = $("meta[name='_csrf_token']").attr("value");
- admin.go('/operator/getoperatorrole', {
+ admin.go('operator/getoperatorrole', {
operid: data.operid,
_csrf: token
}, function (ret) {
@@ -146,7 +146,7 @@
layer.close(i);
layer.load(2);
let token = $("meta[name='_csrf_token']").attr("value");
- admin.go('/operator/resetpwd', {
+ admin.go('operator/resetpwd', {
operid: data.operid,
_csrf: token
}, function (ret) {
@@ -175,7 +175,7 @@
form.on('switch(oper-tpl-state)', function (obj) {
layer.load(2);
let token = $("meta[name='_csrf_token']").attr("value");
- admin.go('/operator/updatestate', {
+ admin.go('/water/operator/updatestate', {
operid: obj.elem.value,
_csrf: token,
state: obj.elem.checked ? 'normal' : 'closed'
diff --git a/src/main/resources/templates/system/operator/operator.html b/src/main/resources/templates/system/operator/operator.html
index a048c1a..d6ae969 100644
--- a/src/main/resources/templates/system/operator/operator.html
+++ b/src/main/resources/templates/system/operator/operator.html
@@ -78,7 +78,7 @@
var msg = "";
$.ajax({
type: "GET",
- url: '/operator/checkopercode',
+ url: '/water/operator/checkopercode',
async: false, //同步提交。不设置则默认异步,异步的话,最后执行ajax
data: {
opercode: e,
@@ -99,7 +99,7 @@
}
});
- var url = '/operator/add';
+ var url = '/water/operator/add';
// 回显user数据
var user = admin.getTempData('t_user');
if (user) {
diff --git a/src/main/resources/templates/system/role/form.html b/src/main/resources/templates/system/role/form.html
index fcfcbf3..357ea75 100755
--- a/src/main/resources/templates/system/role/form.html
+++ b/src/main/resources/templates/system/role/form.html
@@ -26,7 +26,7 @@
var layer = layui.layer;
var admin = layui.admin;
var form = layui.form;
- var url = '/role/add';
+ var url = '/water/role/add';
// 回显user数据
var func = admin.getTempData('t_func');
if (func) {
diff --git a/src/main/resources/templates/system/role/func.html b/src/main/resources/templates/system/role/func.html
index 61cc1b1..b724001 100755
--- a/src/main/resources/templates/system/role/func.html
+++ b/src/main/resources/templates/system/role/func.html
@@ -31,7 +31,7 @@
};
$.fn.zTree.init($("#funclist"), menuSetting, nodes);
}
- admin.dgo('/role/func', {
+ admin.dgo('/water/role/func', {
roleId: func,
}, function (data) {
layer.closeAll('loading');
@@ -61,7 +61,7 @@
}
let idStr = ids.toString();
let token = $("meta[name='_csrf_token']").attr("value");
- admin.go('/role/addfunc', {
+ admin.go('/water/role/addfunc', {
roleId: func,
funcs: idStr,
_csrf: token,
diff --git a/src/main/resources/templates/system/role/index.html b/src/main/resources/templates/system/role/index.html
index 029e3ef..837a164 100644
--- a/src/main/resources/templates/system/role/index.html
+++ b/src/main/resources/templates/system/role/index.html
@@ -27,7 +27,7 @@
// 渲染表格
table.render({
elem: '#roletable',
- url: '/role/list',
+ url: '/water/role/list',
page: true,
cols: [
[
@@ -60,7 +60,7 @@
admin.putTempData('t_func', data);
admin.popupCenter({
title: title,
- path: '/role/loadadd',
+ path: '/water/role/loadadd',
finish: function () {
table.reload('roletable', {});
}
@@ -72,7 +72,7 @@
admin.popupCenter({
title: title,
area:['400px','600px'],
- path: '/role/loadfunc'
+ path: '/water/role/loadfunc'
});
};
// 工具条点击事件
@@ -93,7 +93,7 @@
layer.close(i);
layer.load(2);
let token = $("meta[name='_csrf_token']").attr("value");
- admin.go('/role/del', {
+ admin.go('/water/role/del', {
roleid: data.roleId,
_csrf: token
}, function (data) {