用户修改过滤密码字段
This commit is contained in:
parent
b2f33ad7c6
commit
5cd2cd8175
|
@ -10,6 +10,9 @@ import com.zheng.upms.common.constant.UpmsResult;
|
||||||
import com.zheng.upms.common.constant.UpmsResultConstant;
|
import com.zheng.upms.common.constant.UpmsResultConstant;
|
||||||
import com.zheng.upms.dao.model.UpmsUser;
|
import com.zheng.upms.dao.model.UpmsUser;
|
||||||
import com.zheng.upms.dao.model.UpmsUserExample;
|
import com.zheng.upms.dao.model.UpmsUserExample;
|
||||||
|
import com.zheng.upms.rpc.api.UpmsUserOrganizationService;
|
||||||
|
import com.zheng.upms.rpc.api.UpmsUserPermissionService;
|
||||||
|
import com.zheng.upms.rpc.api.UpmsUserRoleService;
|
||||||
import com.zheng.upms.rpc.api.UpmsUserService;
|
import com.zheng.upms.rpc.api.UpmsUserService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
@ -40,6 +43,15 @@ public class UpmsUserController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private UpmsUserService upmsUserService;
|
private UpmsUserService upmsUserService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UpmsUserRoleService upmsUserRoleService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UpmsUserPermissionService upmsUserPermissionService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UpmsUserOrganizationService upmsUserOrganizationService;
|
||||||
|
|
||||||
@ApiOperation(value = "用户首页")
|
@ApiOperation(value = "用户首页")
|
||||||
@RequiresPermissions("upms:user:read")
|
@RequiresPermissions("upms:user:read")
|
||||||
@RequestMapping(value = "/index", method = RequestMethod.GET)
|
@RequestMapping(value = "/index", method = RequestMethod.GET)
|
||||||
|
@ -131,7 +143,6 @@ public class UpmsUserController extends BaseController {
|
||||||
public Object update(@PathVariable("id") int id, UpmsUser upmsUser) {
|
public Object update(@PathVariable("id") int id, UpmsUser upmsUser) {
|
||||||
ComplexResult result = FluentValidator.checkAll()
|
ComplexResult result = FluentValidator.checkAll()
|
||||||
.on(upmsUser.getUsername(), new LengthValidator(1, 20, "帐号"))
|
.on(upmsUser.getUsername(), new LengthValidator(1, 20, "帐号"))
|
||||||
.on(upmsUser.getPassword(), new LengthValidator(5, 32, "密码"))
|
|
||||||
.on(upmsUser.getRealname(), new NotNullValidator("姓名"))
|
.on(upmsUser.getRealname(), new NotNullValidator("姓名"))
|
||||||
.doValidate()
|
.doValidate()
|
||||||
.result(ResultCollectors.toComplex());
|
.result(ResultCollectors.toComplex());
|
||||||
|
|
|
@ -12,10 +12,6 @@
|
||||||
<label for="username">帐号</label>
|
<label for="username">帐号</label>
|
||||||
<input id="username" type="text" class="form-control" name="username" maxlength="20" value="${user.username}">
|
<input id="username" type="text" class="form-control" name="username" maxlength="20" value="${user.username}">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
|
||||||
<label for="password">密码</label>
|
|
||||||
<input id="password" type="text" class="form-control" name="password" maxlength="32" value="${user.password}">
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="realname">姓名</label>
|
<label for="realname">姓名</label>
|
||||||
<input id="realname" type="text" class="form-control" name="realname" maxlength="20" value="${user.realname}">
|
<input id="realname" type="text" class="form-control" name="realname" maxlength="20" value="${user.realname}">
|
||||||
|
@ -67,10 +63,6 @@ function createSubmit() {
|
||||||
$('#username').focus();
|
$('#username').focus();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ($('#password').val() == '' || $('#password').val().length < 5) {
|
|
||||||
$('#password').focus();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
success: function(result) {
|
success: function(result) {
|
||||||
if (result.code != 1) {
|
if (result.code != 1) {
|
||||||
|
|
Loading…
Reference in New Issue