提交 f4fd7a94 编写于 作者: S stevenBeLove

modify userinfo status

上级 be866135
......@@ -24,7 +24,7 @@ spring.servlet.multipart.max-file-size=4194304
#server.servlet.encoding.force=true
#datasource
spring.datasource.username=root
spring.datasource.password=maxkey
spring.datasource.password=root
spring.datasource.url=jdbc:mysql://localhost/maxkey?autoReconnect=true&characterEncoding=UTF-8&serverTimezone=UTC
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
......
......@@ -250,6 +250,15 @@ public class UserInfoController {
return modelAndView;
}
@RequestMapping(value={"/forwardChangeUserinfoStatus/{id}"})
public ModelAndView forwardChangeUserinfoStatus(@PathVariable("id")String id){
ModelAndView modelAndView=new ModelAndView("/userinfo/changeUserinfoStatus");
UserInfo userInfo=userInfoService.get(id);
modelAndView.addObject("model", userInfo);
return modelAndView;
}
@ResponseBody
@RequestMapping(value="/changePassword")
public Message changePassword( @ModelAttribute("userInfo")UserInfo userInfo) {
......@@ -262,6 +271,18 @@ public class UserInfoController {
}
}
@ResponseBody
@RequestMapping(value="/changeUserinfoStatus")
public Message changeUserinfoStatus( @ModelAttribute("userInfo")UserInfo userInfo) {
_logger.debug(userInfo.getId());
if(userInfoService.update(userInfo)) {
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS),MessageType.success);
} else {
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR),MessageType.error);
}
}
@InitBinder
public void binder(WebDataBinder binder) {
binder.registerCustomEditor(String.class, new PropertyEditorSupport() {
......
......@@ -16,7 +16,7 @@ spring.servlet.multipart.max-file-size=4194304
#server.servlet.encoding.force=
#datasource
spring.datasource.username=root
spring.datasource.password=maxkey
spring.datasource.password=root
spring.datasource.url=jdbc:mysql://localhost/maxkey?autoReconnect=true&characterEncoding=UTF-8&serverTimezone=UTC
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
......
......@@ -2,7 +2,7 @@ global.title=MaxKey Secure Management
global.application=Max<span style="color: #FFD700;">Key</span> Secure Management
global.change.language=Language
global.change.language.en=English
global.change.language.zh=\u4e2d\u6587
global.change.language.zh=\u4E2D\u6587
global.text.welcome=Welcome
global.text.manage=Manage
global.text.copyright=CopyRight
......@@ -192,6 +192,11 @@ userinfo.homeFax=homeFax
userinfo.homePhoneNumber=homePhoneNumber
userinfo.homeEmail=homeEmail
userinfo.ims=IMS
userinfo.status=userStatus
userinfo.status.active=active
userinfo.status.withdrawn=withdrawn
userinfo.status.inactive=inactive
userinfo.status.retiree=retiree
userinfo.authnType=AuthenticationType
userinfo.authnType.authnType.1=General login
......
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<#include "../layout/header.ftl"/>
<#include "../layout/common.cssjs.ftl"/>
<style type="text/css">
.table th, .table td {
padding: .2rem;
vertical-align: middle;
}
</style>
<script type="text/javascript">
<!--
$(function(){
});
//-->
</script>
</head>
<body>
<form id="actionForm" method="post" type="label" autoclose="true" action="<@base/>/userinfo/changeUserinfoStatus" class="needs-validation" novalidate>
<table class="table table-bordered" >
<tbody>
<tr>
<th><@locale code="userinfo.displayName" /> :</th>
<td>
<input readonly type="hidden" id="id" name="id" class="required" title="" value="${model.id}"/>
<input readonly type="text" id="displayName" name="displayName" class="form-control" title="" value="${model.displayName}"/>
</td>
</tr>
<tr>
<th><@locale code="userinfo.username" /> :</th>
<td>
<input readonly type="text" id="username" name="username" class="form-control" title="" value="${model.username}"/>
</td>
</tr>
<tr>
<th><@locale code="userinfo.status" />:</th>
<td>
<select name="status" id="status" class="form-control" >
<option value="1" <#if 1==model.status>selected</#if>><@locale code="userinfo.status.active" /></option>
<option value="2" <#if 2==model.status>selected</#if>><@locale code="userinfo.status.withdrawn" /></option>
<option value="3" <#if 3==model.status>selected</#if>><@locale code="userinfo.status.inactive" /></option>
<option value="4" <#if 4==model.status>selected</#if>><@locale code="userinfo.status.retiree" /></option>
</select>
</td>
</tr>
<tr>
<td colspan="2" class="center">
<input id="_method" type="hidden" name="_method" value="post"/>
<input class="button btn btn-primary mr-3" style="width:100px" type="submit" id="submitBtn" value="<@locale code="button.text.save" />"/>
</td>
</tr>
</tbody>
</table>
</form>
</body>
</html>
\ No newline at end of file
......@@ -24,7 +24,7 @@ spring.servlet.multipart.max-file-size=4194304
#server.servlet.encoding.force=true
#datasource
spring.datasource.username=root
spring.datasource.password=maxkey
spring.datasource.password=root
spring.datasource.url=jdbc:mysql://localhost/maxkey?autoReconnect=true&characterEncoding=UTF-8&serverTimezone=UTC
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册