完善默认首页

This commit is contained in:
wanggeng888 2021-02-28 18:22:25 +08:00
parent bd8bd728ef
commit 8c537b782a
18 changed files with 515 additions and 201 deletions

View File

@ -47,7 +47,7 @@ public class ResponseAdvice {
private static final Logger LOG = LoggerFactory.getLogger(ResponseAdvice.class); private static final Logger LOG = LoggerFactory.getLogger(ResponseAdvice.class);
@ResponseBody @ResponseBody
@ExceptionHandler({SystemException.class, SQLSyntaxErrorException.class, Exception.class, HashMapUtil.TypeConversionException.class}) @ExceptionHandler({SystemException.class, SQLSyntaxErrorException.class, Exception.class, HashMapUtil.TypeConversionException.class, ReflectUtil.ReflectException.class})
public void responseException(HttpServletRequest request, HttpServletResponse response, Exception e) throws IOException { public void responseException(HttpServletRequest request, HttpServletResponse response, Exception e) throws IOException {
if (e instanceof InsufficientAuthenticationException) { if (e instanceof InsufficientAuthenticationException) {
throw new InsufficientAuthenticationException(e.getMessage()); throw new InsufficientAuthenticationException(e.getMessage());

View File

@ -17,13 +17,34 @@ import org.springframework.stereotype.Component;
@ConfigurationProperties(prefix = "server") @ConfigurationProperties(prefix = "server")
public class SystemProperties { public class SystemProperties {
/**
* 服务端口
*/
private Integer port; private Integer port;
/**
* 访问地址
*/
private String url; private String url;
/**
* WebSocket 地址
*/
private String ws; private String ws;
/**
* 系统主标题
*/
private String systemTitle; private String systemTitle;
/**
* 系统副标题
*/
private String systemSubTitle; private String systemSubTitle;
private String portalUrl; /**
private String defaultFrame; * 默认 index 页面
*/
private String defaultIndexPage;
/**
* 默认 home 页面
*/
private String defaultHomePage;
public Integer getPort() { public Integer getPort() {
return port; return port;
@ -65,20 +86,20 @@ public class SystemProperties {
this.systemSubTitle = systemSubTitle; this.systemSubTitle = systemSubTitle;
} }
public String getPortalUrl() { public String getDefaultIndexPage() {
return portalUrl == null ? "" : portalUrl.trim(); return defaultIndexPage == null ? "" : defaultIndexPage;
} }
public void setPortalUrl(String portalUrl) { public void setDefaultIndexPage(String defaultIndexPage) {
this.portalUrl = portalUrl; this.defaultIndexPage = defaultIndexPage;
} }
public String getDefaultFrame() { public String getDefaultHomePage() {
return defaultFrame == null ? "" : defaultFrame.trim(); return defaultHomePage == null ? "" : defaultHomePage.trim();
} }
public void setDefaultFrame(String defaultFrame) { public void setDefaultHomePage(String defaultHomePage) {
this.defaultFrame = defaultFrame; this.defaultHomePage = defaultHomePage;
} }
@Override @Override
@ -94,10 +115,10 @@ public class SystemProperties {
.append(systemTitle).append('\"'); .append(systemTitle).append('\"');
sb.append(",\"systemSubTitle\":\"") sb.append(",\"systemSubTitle\":\"")
.append(systemSubTitle).append('\"'); .append(systemSubTitle).append('\"');
sb.append(",\"portalUrl\":\"") sb.append(",\"defaultIndexPage\":\"")
.append(portalUrl).append('\"'); .append(defaultIndexPage).append('\"');
sb.append(",\"defaultFrame\":\"") sb.append(",\"defaultHomePage\":\"")
.append(defaultFrame).append('\"'); .append(defaultHomePage).append('\"');
sb.append('}'); sb.append('}');
return sb.toString(); return sb.toString();
} }

View File

@ -50,14 +50,6 @@ public class CountController extends DefaultBaseController {
return new SuccessResultData<>(countService.countUser(params)); return new SuccessResultData<>(countService.countUser(params));
} }
@ApiOperation(value = "Oauth客户端统计", notes = "Oauth客户端统计接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("count-oauth-client")
public SuccessResultData<Map<String, Object>> countOauthClient() {
Map<String, Object> params = getParams();
return new SuccessResultData<>(countService.countOauthClient(params));
}
@ApiOperation(value = "系统登录量统计", notes = "系统登录量统计接口") @ApiOperation(value = "系统登录量统计", notes = "系统登录量统计接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("count-login") @GetMapping("count-login")

View File

@ -40,7 +40,20 @@ public class IndexRouteController {
@GetMapping("index") @GetMapping("index")
public ModelAndView goIndex() { public ModelAndView goIndex() {
ModelAndView mv = new ModelAndView("index"); if (!StringUtils.isBlank(systemProperties.getDefaultIndexPage())) {
return new ModelAndView(new RedirectView(systemProperties.getDefaultHomePage()));
}
return new ModelAndView("forward:/default-main");
}
/**
* 默认主页
*
* @return
*/
@GetMapping("default-main")
public ModelAndView defaultMain() {
ModelAndView mv = new ModelAndView("default-main");
UserInfoBO userInfoBO = securityComponent.getCurrentUser(); UserInfoBO userInfoBO = securityComponent.getCurrentUser();
mv.addObject("userUsername", userInfoBO.getUserUsername()); mv.addObject("userUsername", userInfoBO.getUserUsername());
Map<String, Object> config = ConfigManager.getInstance().getConfig(); Map<String, Object> config = ConfigManager.getInstance().getConfig();
@ -69,17 +82,17 @@ public class IndexRouteController {
} }
/** /**
* 默认 * 默认导航首页
* *
* @return * @return
*/ */
@GetMapping("default-frame") @GetMapping("default-home")
public ModelAndView defaultFrame() { public ModelAndView defaultHome() {
ModelAndView mv; ModelAndView mv;
if (!StringUtils.isBlank(systemProperties.getDefaultFrame())) { if (!StringUtils.isBlank(systemProperties.getDefaultHomePage())) {
mv = new ModelAndView(new RedirectView(systemProperties.getDefaultFrame())); mv = new ModelAndView(new RedirectView(systemProperties.getDefaultHomePage()));
} else { } else {
mv = new ModelAndView("default"); mv = new ModelAndView("default-home");
} }
return mv; return mv;
} }

View File

@ -33,12 +33,6 @@ public interface ICountService {
*/ */
Map<String, Object> countUser(Map<String, Object> params); Map<String, Object> countUser(Map<String, Object> params);
/**
* @param params
* @return
*/
Map<String, Object> countOauthClient(Map<String, Object> params);
/** /**
* 系统登录量统计 * 系统登录量统计
* *

View File

@ -71,12 +71,6 @@ public class CountServiceImpl extends DefaultBaseService implements ICountServic
return result; return result;
} }
@Override
public Map<String, Object> countOauthClient(Map<String, Object> params) {
Map<String, Object> result = getHashMap(4);
return null;
}
@Override @Override
public Map<String, Object> countLogin(Map<String, Object> params) { public Map<String, Object> countLogin(Map<String, Object> params) {
DateTime now = DateTime.now(); DateTime now = DateTime.now();
@ -168,12 +162,12 @@ public class CountServiceImpl extends DefaultBaseService implements ICountServic
Map<String, Object> normalUserCountResult = getHashMap(3); Map<String, Object> normalUserCountResult = getHashMap(3);
normalUserCountResult.put("name", "正常用户"); normalUserCountResult.put("name", "正常用户");
normalUserCountResult.put("value", normalUserCount); normalUserCountResult.put("value", normalUserCount);
normalUserCountResult.put("color", "#1E9FFF"); normalUserCountResult.put("color", "#009688");
Map<String, Object> lockingUserCountResult = getHashMap(3); Map<String, Object> lockingUserCountResult = getHashMap(3);
lockingUserCountResult.put("name", "锁定用户"); lockingUserCountResult.put("name", "锁定用户");
lockingUserCountResult.put("value", lockingUserCount); lockingUserCountResult.put("value", lockingUserCount);
lockingUserCountResult.put("color", "#009688"); lockingUserCountResult.put("color", "#1E9FFF");
List<Map<String, Object>> result = new ArrayList<>(); List<Map<String, Object>> result = new ArrayList<>();
result.add(normalUserCountResult); result.add(normalUserCountResult);

View File

@ -47,7 +47,7 @@ public class LoginBaseStartUp implements ApplicationRunner {
LOG.debug("创建 sys_config 表"); LOG.debug("创建 sys_config 表");
configDao.createTable(); configDao.createTable();
LOG.debug("创建 log_login"); LOG.debug("创建 log_login_log");
loginLogDao.createTable(); loginLogDao.createTable();
} }

View File

@ -54,7 +54,7 @@
1 = 1 1 = 1
<if test="day != null and day != ''"> <if test="day != null and day != ''">
AND AND
LEFT(gmt_create, 10) = #{currentDay} LEFT(gmt_create, 10) = #{day}
</if> </if>
</select> </select>

View File

@ -9,6 +9,11 @@
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/> <link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all"> <link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all"> <link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
<style>
.layui-badge {height: auto;}
.layui-card-header {overflow: hidden; white-space: nowrap; text-overflow: ellipsis;}
.count-second-row {padding-bottom: 0px;}
</style>
</head> </head>
<body> <body>
@ -16,7 +21,7 @@
<div class="layui-row layui-col-space15"> <div class="layui-row layui-col-space15">
<div class="layui-col-sm12 layui-col-md6"> <div class="layui-col-sm12 layui-col-md6">
<div class="layui-row layui-col-space15"> <div class="layui-row layui-col-space15">
<div class="layui-col-sm12 layui-col-md4"> <div class="layui-col-sm4 layui-col-md4">
<div class="layui-card"> <div class="layui-card">
<div class="layui-card-header"> <div class="layui-card-header">
系统登录用户量 系统登录用户量
@ -33,7 +38,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-col-sm12 layui-col-md4"> <div class="layui-col-sm4 layui-col-md4">
<div class="layui-card"> <div class="layui-card">
<div class="layui-card-header"> <div class="layui-card-header">
新增用户量 新增用户量
@ -50,7 +55,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-col-sm12 layui-col-md4"> <div class="layui-col-sm4 layui-col-md4">
<div class="layui-card"> <div class="layui-card">
<div class="layui-card-header"> <div class="layui-card-header">
总用户量 总用户量
@ -69,7 +74,7 @@
</div> </div>
</div> </div>
<div class="layui-row layui-col-space15"> <div class="layui-row layui-col-space15">
<div class="layui-col-sm12 layui-col-md4"> <div class="layui-col-sm4 layui-col-md4">
<div class="layui-card"> <div class="layui-card">
<div class="layui-card-header"> <div class="layui-card-header">
机构数量 机构数量
@ -80,7 +85,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-col-sm12 layui-col-md4"> <div class="layui-col-sm4 layui-col-md4">
<div class="layui-card"> <div class="layui-card">
<div class="layui-card-header"> <div class="layui-card-header">
角色数量 角色数量
@ -91,7 +96,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-col-sm12 layui-col-md4"> <div class="layui-col-sm4 layui-col-md4">
<div class="layui-card"> <div class="layui-card">
<div class="layui-card-header"> <div class="layui-card-header">
职位数量 职位数量
@ -115,7 +120,25 @@
</div> </div>
</div> </div>
<div class="layui-row layui-col-space15"> <div class="layui-row layui-col-space15">
<div class="layui-col-sm12 layui-col-md6"> <div class="layui-col-sm6 layui-col-md6">
<div class="layui-card">
<div class="layui-card-header">用户状态占比</div>
<div class="layui-card-body">
<div id="userTypeEChart" style="width: 100%; height: 300px;"></div>
</div>
</div>
</div>
<div class="layui-col-sm6 layui-col-md6">
<div class="layui-card">
<div class="layui-card-header">用户类型占比</div>
<div class="layui-card-body">
<div id="userStateEChart" style="width: 100%; height: 300px;"></div>
</div>
</div>
</div>
</div>
<div class="layui-row layui-col-space15">
<div class="layui-col-sm6 layui-col-md6">
<div class="layui-card"> <div class="layui-card">
<div class="layui-card-header"> <div class="layui-card-header">
系统登录日志最新10条 系统登录日志最新10条
@ -140,7 +163,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-col-sm12 layui-col-md6"> <div class="layui-col-sm6 layui-col-md6">
<div class="layui-card"> <div class="layui-card">
<div class="layui-card-header"> <div class="layui-card-header">
用户调整日志最新10条 用户调整日志最新10条
@ -171,33 +194,7 @@
</div> </div>
</div> </div>
<div class="layui-row layui-col-space15"> <div class="layui-row layui-col-space15">
<div class="layui-col-sm12 layui-col-md4"> <div class="layui-col-sm6 layui-col-md6">
<div class="layui-card">
<div class="layui-card-header">用户状态占比</div>
<div class="layui-card-body">
<div id="userTypeEChart" style="width: 100%; height: 267px;"></div>
</div>
</div>
</div>
<div class="layui-col-sm12 layui-col-md4">
<div class="layui-card">
<div class="layui-card-header">用户类型占比</div>
<div class="layui-card-body">
<div id="userStateEChart" style="width: 100%; height: 267px;"></div>
</div>
</div>
</div>
<div class="layui-col-sm12 layui-col-md4">
<div class="layui-card">
<div class="layui-card-header">登录类型占比</div>
<div class="layui-card-body">
<div id="loginTypeEChart" style="width: 100%; height: 267px;"></div>
</div>
</div>
</div>
</div>
<div class="layui-row layui-col-space15">
<div class="layui-col-sm12 layui-col-md6">
<div class="layui-card"> <div class="layui-card">
<div class="layui-card-header"> <div class="layui-card-header">
机构变更日志最新6条 机构变更日志最新6条
@ -227,7 +224,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-col-sm12 layui-col-md6"> <div class="layui-col-sm6 layui-col-md6">
<div class="layui-card"> <div class="layui-card">
<div class="layui-card-header"> <div class="layui-card-header">
机构用户调整日志最新20条 机构用户调整日志最新20条
@ -270,6 +267,7 @@
index: 'lib/index' //主入口模块 index: 'lib/index' //主入口模块
}).use(['index', 'animate-numbers'], function() { }).use(['index', 'animate-numbers'], function() {
var $ = layui.$; var $ = layui.$;
var $win = $(window);
new Vue({ new Vue({
el: '#LAY-app', el: '#LAY-app',
data: { data: {
@ -285,12 +283,15 @@
loginLoggerList: [], loginLoggerList: [],
userAdjustmentList: [], userAdjustmentList: [],
departmentAdjustmentList: [], departmentAdjustmentList: [],
userDepartmentAdjustmentList: [] userDepartmentAdjustmentList: [],
resizeTimeout: null,
loginEChart: null,
userTypeEChart: null
}, },
methods: { methods: {
countUserWeek: function() { countUserWeek: function() {
var self = this; var self = this;
top.restAjax.get('api/count/countnewuserbyweek', {}, null, function(code, data) { top.restAjax.get('api/count/count-new-user-by-week', {}, null, function(code, data) {
self.newUserWeekCount = data.data.count; self.newUserWeekCount = data.data.count;
self.userWeekPercentage = data.data.percentage; self.userWeekPercentage = data.data.percentage;
self.$nextTick(function() { self.$nextTick(function() {
@ -303,7 +304,7 @@
}, },
countLogin: function() { countLogin: function() {
var self = this; var self = this;
top.restAjax.get('api/count/countlogin', {}, null, function(code, data) { top.restAjax.get('api/count/count-login', {}, null, function(code, data) {
self.loginCount = data.data.count; self.loginCount = data.data.count;
self.loginPercentage = data.data.percentage self.loginPercentage = data.data.percentage
self.$nextTick(function() { self.$nextTick(function() {
@ -316,7 +317,7 @@
}, },
countUser: function() { countUser: function() {
var self = this; var self = this;
top.restAjax.get('api/count/countuser', {}, null, function(code, data) { top.restAjax.get('api/count/count-user', {}, null, function(code, data) {
self.userCount = data.data.count; self.userCount = data.data.count;
self.userMonthNewCount = data.data.newCount; self.userMonthNewCount = data.data.newCount;
self.$nextTick(function() { self.$nextTick(function() {
@ -329,7 +330,7 @@
}, },
countDepartment: function() { countDepartment: function() {
var self = this; var self = this;
top.restAjax.get('api/count/countdepartment', {}, null, function(code, data) { top.restAjax.get('api/count/count-department', {}, null, function(code, data) {
self.departmentCount = data.data; self.departmentCount = data.data;
self.$nextTick(function() { self.$nextTick(function() {
$('#departmentCount').animateNumbers(self.departmentCount); $('#departmentCount').animateNumbers(self.departmentCount);
@ -340,7 +341,7 @@
}, },
countRole: function() { countRole: function() {
var self = this; var self = this;
top.restAjax.get('api/count/countrole', {}, null, function(code, data) { top.restAjax.get('api/count/count-role', {}, null, function(code, data) {
self.roleCount = data.data; self.roleCount = data.data;
self.$nextTick(function() { self.$nextTick(function() {
$('#roleCount').animateNumbers(self.roleCount); $('#roleCount').animateNumbers(self.roleCount);
@ -351,7 +352,7 @@
}, },
countPosition: function() { countPosition: function() {
var self = this; var self = this;
top.restAjax.get('api/count/countposition', {}, null, function(code, data) { top.restAjax.get('api/count/count-position', {}, null, function(code, data) {
self.positionCount = data.data; self.positionCount = data.data;
self.$nextTick(function() { self.$nextTick(function() {
$('#positionCount').animateNumbers(self.positionCount); $('#positionCount').animateNumbers(self.positionCount);
@ -362,9 +363,13 @@
}, },
initLoginEChart: function() { initLoginEChart: function() {
var self = this; var self = this;
top.restAjax.get('api/count/countloginfordays/10', {}, null, function(code, data) { if(self.loginEChart) {
var echart = echarts.init(document.getElementById('loginEChart')); self.loginEChart.resize();
echart.setOption({ return;
}
top.restAjax.get('api/count/count-login-for-days/10', {}, null, function(code, data) {
self.loginEChart = echarts.init(document.getElementById('loginEChart'));
self.loginEChart.setOption({
title: { title: {
text: '近期系统登录情况' text: '近期系统登录情况'
}, },
@ -415,8 +420,12 @@
}, },
initUserTypeEChart: function() { initUserTypeEChart: function() {
var self = this; var self = this;
top.restAjax.get('api/count/countusertypeproportion', {}, null, function(code, data) { if(self.userTypeEChart) {
var echart = echarts.init(document.getElementById('userTypeEChart')); self.userTypeEChart.resize();
return;
}
top.restAjax.get('api/count/count-user-type-proportion', {}, null, function(code, data) {
self.userTypeEChart = echarts.init(document.getElementById('userTypeEChart'));
var legendData = []; var legendData = [];
var seriesData = []; var seriesData = [];
for(var i = 0, item; item = data.data[i++];) { for(var i = 0, item; item = data.data[i++];) {
@ -429,8 +438,7 @@
} }
}) })
} }
self.userTypeEChart.setOption({
echart.setOption({
tooltip: { tooltip: {
trigger: 'item', trigger: 'item',
formatter: '{a} <br/>{b}: {c} ({d}%)' formatter: '{a} <br/>{b}: {c} ({d}%)'
@ -494,8 +502,12 @@
}, },
initUserStateEChart: function() { initUserStateEChart: function() {
var self = this; var self = this;
top.restAjax.get('api/count/countuserstateproportion', {}, null, function(code, data) { if(self.userStateEChart) {
var echart = echarts.init(document.getElementById('userStateEChart')); self.userStateEChart.resize();
return;
}
top.restAjax.get('api/count/count-user-state-proportion', {}, null, function(code, data) {
self.userStateEChart = echarts.init(document.getElementById('userStateEChart'));
var legendData = []; var legendData = [];
var seriesData = []; var seriesData = [];
for(var i = 0, item; item = data.data[i++];) { for(var i = 0, item; item = data.data[i++];) {
@ -508,7 +520,7 @@
} }
}) })
} }
echart.setOption({ self.userStateEChart.setOption({
tooltip: { tooltip: {
trigger: 'item', trigger: 'item',
formatter: '{a} <br/>{b}: {c} ({d}%)' formatter: '{a} <br/>{b}: {c} ({d}%)'
@ -570,85 +582,9 @@
top.dialog.msg(data.msg); top.dialog.msg(data.msg);
}); });
}, },
initLoginTypeEChart: function() {
var self = this;
top.restAjax.get('api/count/countlogintypeproportion', {}, null, function(code, data) {
var echart = echarts.init(document.getElementById('loginTypeEChart'));
var legendData = [];
var seriesData = [];
for(var i = 0, item; item = data.data[i++];) {
legendData.push(item.name);
seriesData.push({
name: item.name,
value: item.value,
})
}
echart.setOption({
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b}: {c} ({d}%)'
},
legend: {
orient: 'vertical',
left: 10,
data: legendData
},
series: [
{
name: '登录类型占比',
type: 'pie',
radius: '66%',
avoidLabelOverlap: false,
label: {
formatter: '{b|{b}}\n{hr|}\n {c|{c}} {per|{d}%} ',
backgroundColor: '#eee',
borderColor: '#aaa',
borderWidth: 0.5,
borderRadius: 4,
rich: {
b: {
fontSize: 14,
lineHeight: 22,
align: 'center'
},
hr: {
borderColor: '#aaa',
width: '100%',
borderWidth: 0.5,
height: 0
},
per: {
color: '#eee',
backgroundColor: '#334455',
padding: [2, 4],
borderRadius: 2
},
c: {
fontSize: 14,
lineHeight: 22,
align: 'center'
},
}
},
emphasis: {
label: {
show: true,
fontSize: '14',
fontWeight: 'bold'
}
},
data: seriesData
}
]
});
}, function(code, data) {
top.dialog.msg(data.msg);
});
},
initLoginLogger: function() { initLoginLogger: function() {
var self = this; var self = this;
top.restAjax.get(top.restAjax.path('api/logger/listpageloginlogger', []), { top.restAjax.get(top.restAjax.path('api/log/listpage/login-log', []), {
page: 1, page: 1,
rows: 10 rows: 10
}, null, function(code, data) { }, null, function(code, data) {
@ -659,7 +595,7 @@
}, },
initUserAdjustment: function() { initUserAdjustment: function() {
var self = this; var self = this;
top.restAjax.get(top.restAjax.path('api/logger/listpageuseradjustment', []), { top.restAjax.get(top.restAjax.path('api/log/listpage/user-adjustment', []), {
page: 1, page: 1,
rows: 10 rows: 10
}, null, function(code, data) { }, null, function(code, data) {
@ -670,7 +606,7 @@
}, },
initDepartmentAdjustment: function() { initDepartmentAdjustment: function() {
var self = this; var self = this;
top.restAjax.get(top.restAjax.path('api/logger/listpagedepartmentadjustment', []), { top.restAjax.get(top.restAjax.path('api/log/listpage/department-adjustment', []), {
page: 1, page: 1,
rows: 10 rows: 10
}, null, function(code, data) { }, null, function(code, data) {
@ -679,9 +615,9 @@
top.dialog.msg(data.msg); top.dialog.msg(data.msg);
}); });
}, },
initUserDepartmentAdjustment: function() { initDepartmentUserAdjustment: function() {
var self = this; var self = this;
top.restAjax.get(top.restAjax.path('api/logger/listpageuserdepartmentadjustment', []), { top.restAjax.get(top.restAjax.path('api/log/listpage/department-user-adjustment', []), {
page: 1, page: 1,
rows: 20 rows: 20
}, null, function(code, data) { }, null, function(code, data) {
@ -702,11 +638,22 @@
self.initLoginEChart(); self.initLoginEChart();
self.initUserTypeEChart(); self.initUserTypeEChart();
self.initUserStateEChart(); self.initUserStateEChart();
self.initLoginTypeEChart();
self.initLoginLogger(); self.initLoginLogger();
self.initUserAdjustment(); self.initUserAdjustment();
self.initDepartmentAdjustment(); self.initDepartmentAdjustment();
self.initUserDepartmentAdjustment(); self.initDepartmentUserAdjustment();
// 事件 - 页面变化
$win.on('resize', function() {
if(self.resizeTimeout) {
return;
}
self.resizeTimeout = setTimeout(function() {
self.initLoginEChart();
self.initUserTypeEChart();
self.initUserStateEChart();
self.resizeTimeout = null;
}, 500);
});
} }
}) })
}); });

View File

@ -0,0 +1,214 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<base th:href="${#request.getContextPath() + '/'}">
<title th:text="${loginPageName}"></title>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="icon" type="image/ico" href="assets/favicon.ico"/>
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css">
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
</head>
<body class="layui-layout-body">
<div id="LAY_app">
<div class="layui-layout layui-layout-admin">
<div class="layui-header">
<!-- 头部区域 -->
<ul class="layui-nav layui-layout-left">
<li class="layui-nav-item layadmin-flexible" lay-unselect>
<a href="javascript:void(0);" layadmin-event="flexible" title="侧边伸缩">
<i class="layui-icon layui-icon-shrink-right" id="LAY_app_flexible"></i>
</a>
</li>
<li class="layui-nav-item layui-hide-xs" lay-unselect>
<a href="index" title="首页">
<i class="layui-icon layui-icon-website"></i>
</a>
</li>
<li class="layui-nav-item" lay-unselect>
<a href="javascript:void(0);" layadmin-event="refresh" title="刷新">
<i class="layui-icon layui-icon-refresh-3"></i>
</a>
</li>
</ul>
<ul class="layui-nav layui-layout-right" lay-filter="layadmin-layout-right">
<li class="layui-nav-item layui-hide-xs" lay-unselect>
<a href="javascript:void(0);" layadmin-event="theme">
<i class="layui-icon layui-icon-theme"></i>
</a>
</li>
<li class="layui-nav-item layui-hide-xs" lay-unselect>
<a href="javascript:void(0);" layadmin-event="note">
<i class="layui-icon layui-icon-note"></i>
</a>
</li>
<li class="layui-nav-item layui-hide-xs" lay-unselect>
<a href="javascript:void(0);" layadmin-event="fullscreen">
<i class="layui-icon layui-icon-screen-full"></i>
</a>
</li>
<li class="layui-nav-item" lay-unselect>
<a href="javascript:void(0);">
<cite th:text="${userUsername}"></cite>
</a>
<dl class="layui-nav-child">
<dd><a id="LAY-changePassword" lay-href="javascript:void(0);">修改密码</a></dd>
<hr>
<dd id="LAY-logout" style="text-align: center;"><a href="javascript:void(0);">退出</a></dd>
</dl>
</li>
<li class="layui-nav-item layui-hide-xs" lay-unselect>
<a href="javascript:void(0);" layadmin-event="about"><i class="layui-icon layui-icon-more-vertical"></i></a>
</li>
<li class="layui-nav-item layui-show-xs-inline-block layui-hide-sm" lay-unselect>
<a href="javascript:void(0);" layadmin-event="more"><i class="layui-icon layui-icon-more-vertical"></i></a>
</li>
</ul>
</div>
<!-- 侧边菜单 -->
<div class="layui-side layui-side-menu">
<div class="layui-side-scroll">
<div class="layui-logo">
<img th:src="'route/file/download/true/'+ ${systemLogo}" style="width: 32px; height: 32px;" th:if="${systemLogo ne ''}">
<span th:text="${systemTitle}" style="font-weight: bold;"></span>
</div>
<ul class="layui-nav layui-nav-tree" lay-shrink="all" id="LAY-system-side-menu" lay-filter="layadmin-system-side-menu">
<li data-name="component" class="layui-nav-item" th:each="menu1: ${menus}" th:title="${menu1.menuSummary}">
<a href="javascript:void(0);" th:if="${!#lists.isEmpty(menu1.subMenus)}" th:attr="lay-tips=${menu1.menuName}" lay-direction="2">
<span class="layui-icon">
<i th:class="${menu1.menuIcon}"></i>
</span>
<cite th:text="${menu1.menuName}"></cite>
</a>
<a href="javascript:void(0);" th:if="${#lists.isEmpty(menu1.subMenus)}" th:attr="lay-tips=${menu1.menuName},lay-href=${menu1.menuUrl} ,lay-open-type=${menu1.openType}" lay-direction="2">
<span class="layui-icon">
<i th:class="${menu1.menuIcon}"></i>
</span>
<cite th:text="${menu1.menuName}"></cite>
</a>
<dl class="layui-nav-child" th:if="${!#lists.isEmpty(menu1.subMenus)}">
<dd data-name="grid" th:each="menu2: ${menu1.subMenus}" th:title="${menu2.menuSummary}">
<a href="javascript:void(0);" th:if="${!#lists.isEmpty(menu2.subMenus)}">
<span class="layui-icon">
<i th:class="${menu2.menuIcon}"></i>
</span>
<cite th:text="${menu2.menuName}"></cite>
</a>
<a href="javascript:void(0);" th:if="${#lists.isEmpty(menu2.subMenus)}" th:attr="lay-href=${menu2.menuUrl}, lay-open-type=${menu2.openType}">
<span class="layui-icon">
<i th:class="${menu2.menuIcon}"></i>
</span>
<cite th:text="${menu2.menuName}"></cite>
</a>
<dl class="layui-nav-child" th:if="${!#lists.isEmpty(menu2.subMenus)}">
<dd data-name="list" th:each="menu3: ${menu2.subMenus}" th:title="${menu3.menuSummary}">
<a href="javascript:void(0)" th:text="${menu3.menuName}" th:attr="lay-href=${menu3.menuUrl}, lay-open-type=${menu3.openType}"></a>
</dd>
</dl>
</dd>
</dl>
</li>
</ul>
</div>
</div>
<!-- 页面标签 -->
<div class="layadmin-pagetabs" id="LAY_app_tabs">
<div class="layui-icon layadmin-tabs-control layui-icon-prev" layadmin-event="leftPage"></div>
<div class="layui-icon layadmin-tabs-control layui-icon-next" layadmin-event="rightPage"></div>
<div class="layui-icon layadmin-tabs-control layui-icon-down">
<ul class="layui-nav layadmin-tabs-select" lay-filter="layadmin-pagetabs-nav">
<li class="layui-nav-item" lay-unselect>
<a href="javascript:void(0);"></a>
<dl class="layui-nav-child layui-anim-fadein">
<dd layadmin-event="closeThisTabs"><a href="javascript:void(0);">关闭当前标签页</a></dd>
<dd layadmin-event="closeOtherTabs"><a href="javascript:void(0);">关闭其它标签页</a></dd>
<dd layadmin-event="closeAllTabs"><a href="javascript:void(0);">关闭全部标签页</a></dd>
</dl>
</li>
</ul>
</div>
<div class="layui-tab" lay-unauto lay-allowClose="true" lay-filter="layadmin-layout-tabs">
<ul class="layui-tab-title" id="LAY_app_tabsheader">
<li lay-id="default.html" lay-attr="default.html" class="layui-this"><i class="layui-icon layui-icon-home"></i></li>
</ul>
</div>
</div>
<!-- 主体内容 -->
<div class="layui-body" id="LAY_app_body">
<div class="layadmin-tabsbody-item layui-show">
<iframe id="defaultIFrame" frameborder="0" class="layadmin-iframe"></iframe>
</div>
</div>
<!-- 辅助元素,一般用于移动设备下遮罩 -->
<div class="layadmin-body-shade" layadmin-event="shade"></div>
</div>
</div>
<script src="assets/layuiadmin/layui/layui.js"></script>
<script>
layui.config({
base: 'assets/layuiadmin/' //静态资源所在路径
}).extend({
index: 'lib/index' //主入口模块
}).use(['index', 'restajax', 'datamessage', 'dialog'], function() {
var $ = layui.$;
var layer = layui.layer;
window.dialog = layui.dialog;
window.restAjax = layui.restajax;
window.dataMessage = layui.datamessage;
function changePassword() {
top.dialog.open({
url: top.restAjax.path('route/user/update-password', []),
title: '修改密码',
width: '400px',
height: '290px',
onClose: function() {
window.location.href = 'oauth/logout';
}
});
}
function checkPasswordStatus() {
top.restAjax.get(top.restAjax.path('api/user/get-password-status', []), {}, null, function(code, data) {
if(data.data == 'change') {
changePassword();
} else if(data.data == 'remind') {
layer.open({
title: '警告!',
content: '密码已过期,为确保账号安全,请尽快修改密码!',
auto: ['100px', '80px'],
offset: 'rb'
});
}
}, function(code, data) {
top.dialog.message(data.msg);
});
}
checkPasswordStatus();
$('#LAY-changePassword').on('click', function() {
changePassword()
});
$('#defaultIFrame').attr('src', 'default-home');
$('#LAY-logout').on('click', function() {
top.dialog.confirm('确认退出?', function() {
window.location.href = 'oauth/logout';
});
});
});
</script>
</body>
</html>

View File

@ -63,7 +63,7 @@
creator_name, creator_name,
LEFT(gmt_create, 19) gmt_create LEFT(gmt_create, 19) gmt_create
FROM FROM
sys_user_department_adjustment sys_department_user_adjustment
WHERE WHERE
1 = 1 1 = 1
<if test="adjustmentType != null and adjustmentType != ''"> <if test="adjustmentType != null and adjustmentType != ''">
@ -86,7 +86,7 @@
LEFT(gmt_create, 10) <![CDATA[ <= ]]> #{endTime} LEFT(gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
</if> </if>
ORDER BY ORDER BY
gmt_create DESC, id DESC gmt_create DESC, id DESC
</select> </select>
</mapper> </mapper>

View File

@ -173,8 +173,8 @@
} }
top.dialog.dialogData.selectedUserIds = splitDepartment.userIds; top.dialog.dialogData.selectedUserIds = splitDepartment.userIds;
top.dialog.open({ top.dialog.open({
url: top.restAjax.path('route/system/user/select-department-user.html', []), url: top.restAjax.path('route/department/user/select-user', []),
title: '选择组织部门人员', title: '选择用户',
width: '500px', width: '500px',
height: '500px', height: '500px',
onClose: function() { onClose: function() {

View File

@ -5,18 +5,17 @@ import ink.wgink.common.base.DefaultBaseController;
import ink.wgink.exceptions.ParamsException; import ink.wgink.exceptions.ParamsException;
import ink.wgink.interfaces.consts.IFileConstant; import ink.wgink.interfaces.consts.IFileConstant;
import ink.wgink.interfaces.consts.ISystemConstant; import ink.wgink.interfaces.consts.ISystemConstant;
import ink.wgink.interfaces.manager.ISystemConfigManager;
import ink.wgink.pojo.vos.IdsVO; import ink.wgink.pojo.vos.IdsVO;
import ink.wgink.service.user.pojo.vos.RestPasswordVO; import ink.wgink.service.user.pojo.vos.*;
import ink.wgink.service.user.pojo.vos.UpdateExpiredDateVO;
import ink.wgink.service.user.pojo.vos.UpdateUsernameVO;
import ink.wgink.pojo.ListPage; import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.dtos.user.UserDTO; import ink.wgink.pojo.dtos.user.UserDTO;
import ink.wgink.pojo.result.ErrorResult; import ink.wgink.pojo.result.ErrorResult;
import ink.wgink.pojo.result.SuccessResult; import ink.wgink.pojo.result.SuccessResult;
import ink.wgink.pojo.result.SuccessResultList; import ink.wgink.pojo.result.SuccessResultList;
import ink.wgink.service.user.pojo.vos.UserVO;
import ink.wgink.service.user.service.IUserService; import ink.wgink.service.user.service.IUserService;
import ink.wgink.pojo.result.UploadExcelResultDTO; import ink.wgink.pojo.result.UploadExcelResultDTO;
import ink.wgink.util.ReflectUtil;
import ink.wgink.util.RegexUtil; import ink.wgink.util.RegexUtil;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -116,6 +115,40 @@ public class UserController extends DefaultBaseController {
return new SuccessResult(); return new SuccessResult();
} }
@ApiOperation(value = "修改密码", notes = "修改密码接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PutMapping("update-password")
@CheckRequestBodyAnnotation
public SuccessResult updatePassword(@RequestBody UpdatePasswordVO updatePasswordVO) throws ReflectUtil.ReflectException {
ISystemConfigManager systemConfigManager = ReflectUtil.getSingleInstance("ink.wgink.login.base.manager.ConfigManager", ISystemConfigManager.class);
if (systemConfigManager != null) {
checkUpdatePasswordParams(systemConfigManager.getConfig(), updatePasswordVO);
}
userService.updatePassword(updatePasswordVO);
return new SuccessResult();
}
/**
* 修改密码参数校验
*
* @param config
* @param updatePasswordVO
*/
private void checkUpdatePasswordParams(Map<String, Object> config, UpdatePasswordVO updatePasswordVO) {
if (config.get(IUserService.PASSWORD_STRENGTH) != null) {
String passwordStrength = config.get(IUserService.PASSWORD_STRENGTH).toString();
if (StringUtils.equals(IUserService.PASSWORD_STRENGTH_MIDDLE, passwordStrength) && !RegexUtil.isPasswordMiddle(updatePasswordVO.getNewPassword())) {
throw new ParamsException(String.format("密码应该%d到%d位包含数字、字母、特殊字符其中的任意两种特殊字符包括%s", RegexUtil.PASSWORD_LENGTH_MIN, RegexUtil.PASSWORD_LENGTH_MAX, RegexUtil.SPECIAL_CHARACTERS));
} else if (StringUtils.equals(IUserService.PASSWORD_STRENGTH_STRONG, passwordStrength) && !RegexUtil.isPasswordStrong(updatePasswordVO.getNewPassword())) {
throw new ParamsException(String.format("密码应该%d到%d位必须全部包含数字、字母、特殊字符三种特殊字符包括%s", RegexUtil.PASSWORD_LENGTH_MIN, RegexUtil.PASSWORD_LENGTH_MAX, RegexUtil.SPECIAL_CHARACTERS));
} else if (!RegexUtil.isPasswordWeek(updatePasswordVO.getNewPassword())) {
throw new ParamsException(String.format("密码应该%d到%d位仅包含数字字母特殊字符其中的一种特殊字符包括%s", RegexUtil.PASSWORD_LENGTH_MIN, RegexUtil.PASSWORD_LENGTH_MAX, RegexUtil.SPECIAL_CHARACTERS));
}
} else if (!RegexUtil.isPasswordWeek(updatePasswordVO.getNewPassword())) {
throw new ParamsException(String.format("密码应该%d到%d位仅包含数字字母特殊字符其中的一种特殊字符包括%s", RegexUtil.PASSWORD_LENGTH_MIN, RegexUtil.PASSWORD_LENGTH_MAX, RegexUtil.SPECIAL_CHARACTERS));
}
}
@ApiOperation(value = "更新过期时间", notes = "更新过期时间接口") @ApiOperation(value = "更新过期时间", notes = "更新过期时间接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PutMapping("update-expired-date/{userId}") @PutMapping("update-expired-date/{userId}")

View File

@ -0,0 +1,53 @@
package ink.wgink.service.user.pojo.vos;
import ink.wgink.annotation.CheckEmptyAnnotation;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* When you feel like quitting. Think about why you started
* 当你想要放弃的时候想想当初你为何开始
*
* @ClassName: AppChangePasswordVO
* @Description: App修改密码
* @Author: WangGeng
* @Date: 2019-08-15 18:41
* @Version: 1.0
**/
@ApiModel
public class UpdatePasswordVO {
@ApiModelProperty(name = "oldPassword", value = "旧密码")
@CheckEmptyAnnotation(name = "旧密码")
private String oldPassword;
@ApiModelProperty(name = "newPassword", value = "新密码")
@CheckEmptyAnnotation(name = "新密码")
private String newPassword;
public String getOldPassword() {
return oldPassword == null ? "" : oldPassword.trim();
}
public void setOldPassword(String oldPassword) {
this.oldPassword = oldPassword;
}
public String getNewPassword() {
return newPassword == null ? "" : newPassword.trim();
}
public void setNewPassword(String newPassword) {
this.newPassword = newPassword;
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("{");
sb.append("\"oldPassword\":")
.append("\"").append(oldPassword).append("\"");
sb.append(",\"newPassword\":")
.append("\"").append(newPassword).append("\"");
sb.append('}');
return sb.toString();
}
}

View File

@ -4,11 +4,9 @@ import ink.wgink.exceptions.SearchException;
import ink.wgink.exceptions.UpdateException; import ink.wgink.exceptions.UpdateException;
import ink.wgink.interfaces.user.IUserBaseService; import ink.wgink.interfaces.user.IUserBaseService;
import ink.wgink.interfaces.user.IUserCheckService; import ink.wgink.interfaces.user.IUserCheckService;
import ink.wgink.pojo.result.SuccessResult;
import ink.wgink.service.user.pojo.pos.UserPO; import ink.wgink.service.user.pojo.pos.UserPO;
import ink.wgink.service.user.pojo.vos.RestPasswordVO; import ink.wgink.service.user.pojo.vos.*;
import ink.wgink.service.user.pojo.vos.UpdateExpiredDateVO;
import ink.wgink.service.user.pojo.vos.UpdateUsernameVO;
import ink.wgink.service.user.pojo.vos.UserVO;
import ink.wgink.pojo.result.UploadExcelResultDTO; import ink.wgink.pojo.result.UploadExcelResultDTO;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@ -28,6 +26,14 @@ import java.util.Map;
*/ */
public interface IUserService extends IUserBaseService, IUserCheckService { public interface IUserService extends IUserBaseService, IUserCheckService {
/**
* 密码强度
*/
String PASSWORD_STRENGTH = "passwordStrength";
String PASSWORD_STRENGTH_WEAK = "weak";
String PASSWORD_STRENGTH_MIDDLE = "middle";
String PASSWORD_STRENGTH_STRONG = "strong";
/** /**
* 保存用户 * 保存用户
* *
@ -78,6 +84,14 @@ public interface IUserService extends IUserBaseService, IUserCheckService {
*/ */
void updateUsername(String userId, UpdateUsernameVO updateUsernameVO); void updateUsername(String userId, UpdateUsernameVO updateUsernameVO);
/**
* 修改密码
*
* @param updatePasswordVO
* @return
*/
void updatePassword(UpdatePasswordVO updatePasswordVO);
/** /**
* 更新过期时间 * 更新过期时间
* *
@ -95,6 +109,14 @@ public interface IUserService extends IUserBaseService, IUserCheckService {
*/ */
UploadExcelResultDTO importExcel(MultipartFile excel) throws IOException; UploadExcelResultDTO importExcel(MultipartFile excel) throws IOException;
/**
* 用户详情
*
* @param userId 用户ID
* @return
*/
UserPO getPO(String userId);
/** /**
* 用户详情 * 用户详情
* *

View File

@ -15,10 +15,7 @@ import ink.wgink.service.user.excel.UserExcelError;
import ink.wgink.service.user.excel.UserExcelListener; import ink.wgink.service.user.excel.UserExcelListener;
import ink.wgink.service.user.pojo.bos.UserAdjustmentBO; import ink.wgink.service.user.pojo.bos.UserAdjustmentBO;
import ink.wgink.service.user.pojo.pos.UserPO; import ink.wgink.service.user.pojo.pos.UserPO;
import ink.wgink.service.user.pojo.vos.RestPasswordVO; import ink.wgink.service.user.pojo.vos.*;
import ink.wgink.service.user.pojo.vos.UpdateExpiredDateVO;
import ink.wgink.service.user.pojo.vos.UpdateUsernameVO;
import ink.wgink.service.user.pojo.vos.UserVO;
import ink.wgink.service.user.service.IUserAdjustmentService; import ink.wgink.service.user.service.IUserAdjustmentService;
import ink.wgink.service.user.service.IUserService; import ink.wgink.service.user.service.IUserService;
import ink.wgink.pojo.ListPage; import ink.wgink.pojo.ListPage;
@ -162,6 +159,32 @@ public class UserServiceImpl extends DefaultBaseService implements IUserService
updateUsernameAdjustment(userId, oldUserDTO.getUserUsername(), updateUsernameVO); updateUsernameAdjustment(userId, oldUserDTO.getUserUsername(), updateUsernameVO);
} }
@Override
public void updatePassword(UpdatePasswordVO updatePasswordVO) {
String oldPassword = DigestUtils.md5Hex(DigestUtils.md5Hex(DigestUtils.md5Hex(updatePasswordVO.getOldPassword())));
String newPassword = DigestUtils.md5Hex(DigestUtils.md5Hex(DigestUtils.md5Hex(updatePasswordVO.getNewPassword())));
UserPO userPO = getPO(securityComponent.getCurrentUser().getUserId());
if (!passwordEncoder.matches(oldPassword, userPO.getUserPassword())) {
throw new UpdateException("旧密码错误");
}
Map<String, Object> params = getHashMap(4);
params.put("userPassword", passwordEncoder.encode(newPassword));
params.put("gmtPasswordModified", DateUtil.getTime());
params.put("userId", userPO.getUserId());
userDao.updatePassword(params);
// 日志
UserAdjustmentBO userAdjustmentBO = new UserAdjustmentBO();
userAdjustmentBO.setUserId(securityComponent.getCurrentUser().getUserId());
userAdjustmentBO.setUserName(securityComponent.getCurrentUser().getUserName());
userAdjustmentBO.setUpdateType(UserUpdateTypeEnum.PASSWORD.getValue());
userAdjustmentBO.setUpdateReason("修改密码");
userAdjustmentBO.setCreator(securityComponent.getCurrentUser().getUserId());
userAdjustmentBO.setCreatorName(securityComponent.getCurrentUser().getUserName());
userAdjustmentBO.setGmtCreate(DateUtil.getTime());
userAdjustmentService.save(userAdjustmentBO);
}
@Override @Override
public void updateExpiredDate(String userId, UpdateExpiredDateVO updateExpiredDateVO) { public void updateExpiredDate(String userId, UpdateExpiredDateVO updateExpiredDateVO) {
UserDTO oldUserDTO = get(userId); UserDTO oldUserDTO = get(userId);
@ -224,6 +247,13 @@ public class UserServiceImpl extends DefaultBaseService implements IUserService
return new UploadExcelResultDTO(userExcelErrors.size(), endTime - startTime, excelFileId); return new UploadExcelResultDTO(userExcelErrors.size(), endTime - startTime, excelFileId);
} }
@Override
public UserPO getPO(String userId) {
Map<String, Object> params = getHashMap(2);
params.put("userId", userId);
return userDao.getPO(params);
}
@Override @Override
public UserPO getPOByUsername(String username) { public UserPO getPOByUsername(String username) {
Map<String, Object> params = getHashMap(2); Map<String, Object> params = getHashMap(2);

View File

@ -197,7 +197,8 @@
UPDATE UPDATE
sys_user sys_user
SET SET
user_password = #{userPassword} user_password = #{userPassword},
gmt_password_modified = #{gmtPasswordModified}
WHERE WHERE
user_id = #{userId} user_id = #{userId}
</update> </update>

View File

@ -65,8 +65,8 @@
top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.confirm(top.dataMessage.commit, function(index) {
top.dialog.close(index); top.dialog.close(index);
var loadLayerIndex; var loadLayerIndex;
top.restAjax.put(top.restAjax.path('api/user/updateuserpassword', []), formData.field, null, function(code, data) { top.restAjax.put(top.restAjax.path('api/user/update-password', []), formData.field, null, function(code, data) {
var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { var layerIndex = top.dialog.msg('修改成功,继续修改?窗口关闭后,需重新登录系统', {
time: 0, time: 0,
btn: [top.dataMessage.button.yes, top.dataMessage.button.no], btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
shade: 0.3, shade: 0.3,