用户修改过滤密码字段

This commit is contained in:
shuzheng 2017-02-26 22:36:11 +08:00
parent b2f33ad7c6
commit 5cd2cd8175
2 changed files with 12 additions and 9 deletions

View File

@ -10,6 +10,9 @@ import com.zheng.upms.common.constant.UpmsResult;
import com.zheng.upms.common.constant.UpmsResultConstant;
import com.zheng.upms.dao.model.UpmsUser;
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 io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -40,6 +43,15 @@ public class UpmsUserController extends BaseController {
@Autowired
private UpmsUserService upmsUserService;
@Autowired
private UpmsUserRoleService upmsUserRoleService;
@Autowired
private UpmsUserPermissionService upmsUserPermissionService;
@Autowired
private UpmsUserOrganizationService upmsUserOrganizationService;
@ApiOperation(value = "用户首页")
@RequiresPermissions("upms:user:read")
@RequestMapping(value = "/index", method = RequestMethod.GET)
@ -131,7 +143,6 @@ public class UpmsUserController extends BaseController {
public Object update(@PathVariable("id") int id, UpmsUser upmsUser) {
ComplexResult result = FluentValidator.checkAll()
.on(upmsUser.getUsername(), new LengthValidator(1, 20, "帐号"))
.on(upmsUser.getPassword(), new LengthValidator(5, 32, "密码"))
.on(upmsUser.getRealname(), new NotNullValidator("姓名"))
.doValidate()
.result(ResultCollectors.toComplex());

View File

@ -12,10 +12,6 @@
<label for="username">帐号</label>
<input id="username" type="text" class="form-control" name="username" maxlength="20" value="${user.username}">
</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">
<label for="realname">姓名</label>
<input id="realname" type="text" class="form-control" name="realname" maxlength="20" value="${user.realname}">
@ -67,10 +63,6 @@ function createSubmit() {
$('#username').focus();
return false;
}
if ($('#password').val() == '' || $('#password').val().length < 5) {
$('#password').focus();
return false;
}
},
success: function(result) {
if (result.code != 1) {