mirror of
https://github.com/yangzongzhuan/RuoYi.git
synced 2025-10-20 12:37:42 +00:00
Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ae1ab1037d | ||
![]() |
32bcd170cd | ||
![]() |
7420a4a39d | ||
![]() |
b5ec0bd9ba | ||
![]() |
0f1fe06195 | ||
![]() |
477f439b7f | ||
![]() |
609f9236fb | ||
![]() |
a9bef0a1bc | ||
![]() |
70194aee09 | ||
![]() |
323d74fd2e | ||
![]() |
029d4e3233 | ||
![]() |
9e264a9692 | ||
![]() |
434ab81e22 | ||
![]() |
bcbb4ac994 | ||
![]() |
4c74687ca2 | ||
![]() |
9f48d2bbe8 |
@@ -98,4 +98,4 @@
|
|||||||
|
|
||||||
## 若依交流群
|
## 若依交流群
|
||||||
|
|
||||||
QQ群: [](https://jq.qq.com/?_wv=1027&k=5HBAaYN) [](https://jq.qq.com/?_wv=1027&k=5cHeRVW) [](https://jq.qq.com/?_wv=1027&k=53R0L5Z) [](https://jq.qq.com/?_wv=1027&k=5g75dCU) [](https://jq.qq.com/?_wv=1027&k=58cPoHA) [](https://jq.qq.com/?_wv=1027&k=5Ofd4Pb) [](https://jq.qq.com/?_wv=1027&k=5yugASz) [](https://jq.qq.com/?_wv=1027&k=5Rf3d2P) [](https://jq.qq.com/?_wv=1027&k=5ZIjaeP) [](https://jq.qq.com/?_wv=1027&k=5CJw1jY) [](https://jq.qq.com/?_wv=1027&k=5omzbKc) [](https://jq.qq.com/?_wv=1027&k=qPIKBb7s) [](https://jq.qq.com/?_wv=1027&k=4NsjKbtU) [](https://jq.qq.com/?_wv=1027&k=VD2pkz2G) [](https://jq.qq.com/?_wv=1027&k=HlshFwkJ) [](https://jq.qq.com/?_wv=1027&k=0ARRrO9V) [](https://jq.qq.com/?_wv=1027&k=up9k3ZXJ) [](https://jq.qq.com/?_wv=1027&k=540WfdEr) [](https://jq.qq.com/?_wv=1027&k=ss91fC4t) [](https://jq.qq.com/?_wv=1027&k=Cqd66IKe) [](https://jq.qq.com/?_wv=1027&k=7FplYUnR) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=lqMHu_5Fskm7H2S1vNAQTtzAUokVydwc&authKey=ptw0Fpch5pbNocML3CIJKKqZBaq2DI7cusKuzIgfMNiY3t9Pvd9hP%2BA8WYx3yaY1&noverify=0&group_code=174942938) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=blYlRDmwZXSXI5pVrPPU7ZJ1stFJ6Q2Q&authKey=ForGBWffHVlPt9NE3d7g4DoOIouBh%2BqvAj2lp1CLReHfZAUaK7SRrdwsChKpRJDJ&noverify=0&group_code=287843737) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=KTVAIhggR3rR3uZWK9A8kR4yYNREQ4jo&authKey=An4DUV9e7uK8I8VgBbp949z0ypQoDrOoqvVg%2FWOr2vuNNDMZUAMPvqHor6TFMIgz&noverify=0&group_code=232896766) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=XwhV8deuZXt__yteR1clNanVSXzA-ugq&authKey=ezgwKqEZPdP%2FgC9I03OBkJb%2Biii8yvVfwrcQuu0%2FL6ILXcRdHYDBFKCXeoeBT0E6&noverify=0&group_code=180208928)
|
QQ群: [](https://jq.qq.com/?_wv=1027&k=5HBAaYN) [](https://jq.qq.com/?_wv=1027&k=5cHeRVW) [](https://jq.qq.com/?_wv=1027&k=53R0L5Z) [](https://jq.qq.com/?_wv=1027&k=5g75dCU) [](https://jq.qq.com/?_wv=1027&k=58cPoHA) [](https://jq.qq.com/?_wv=1027&k=5Ofd4Pb) [](https://jq.qq.com/?_wv=1027&k=5yugASz) [](https://jq.qq.com/?_wv=1027&k=5Rf3d2P) [](https://jq.qq.com/?_wv=1027&k=5ZIjaeP) [](https://jq.qq.com/?_wv=1027&k=5CJw1jY) [](https://jq.qq.com/?_wv=1027&k=5omzbKc) [](https://jq.qq.com/?_wv=1027&k=qPIKBb7s) [](https://jq.qq.com/?_wv=1027&k=4NsjKbtU) [](https://jq.qq.com/?_wv=1027&k=VD2pkz2G) [](https://jq.qq.com/?_wv=1027&k=HlshFwkJ) [](https://jq.qq.com/?_wv=1027&k=0ARRrO9V) [](https://jq.qq.com/?_wv=1027&k=up9k3ZXJ) [](https://jq.qq.com/?_wv=1027&k=540WfdEr) [](https://jq.qq.com/?_wv=1027&k=ss91fC4t) [](https://jq.qq.com/?_wv=1027&k=Cqd66IKe) [](https://jq.qq.com/?_wv=1027&k=7FplYUnR) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=lqMHu_5Fskm7H2S1vNAQTtzAUokVydwc&authKey=ptw0Fpch5pbNocML3CIJKKqZBaq2DI7cusKuzIgfMNiY3t9Pvd9hP%2BA8WYx3yaY1&noverify=0&group_code=174942938) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=blYlRDmwZXSXI5pVrPPU7ZJ1stFJ6Q2Q&authKey=ForGBWffHVlPt9NE3d7g4DoOIouBh%2BqvAj2lp1CLReHfZAUaK7SRrdwsChKpRJDJ&noverify=0&group_code=287843737) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=KTVAIhggR3rR3uZWK9A8kR4yYNREQ4jo&authKey=An4DUV9e7uK8I8VgBbp949z0ypQoDrOoqvVg%2FWOr2vuNNDMZUAMPvqHor6TFMIgz&noverify=0&group_code=232896766) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=XwhV8deuZXt__yteR1clNanVSXzA-ugq&authKey=ezgwKqEZPdP%2FgC9I03OBkJb%2Biii8yvVfwrcQuu0%2FL6ILXcRdHYDBFKCXeoeBT0E6&noverify=0&group_code=180208928) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=WqsGDxpGkqOPeWGOf3I32f_rXxdhqYNr&authKey=kvdF5df7PO9bzWxmixKhZN6ShsECBiuGUmmzTZBWVr2MVOfJ8%2F4oD0Gws0rbgYfz&noverify=0&group_code=140284548)
|
6
pom.xml
6
pom.xml
@@ -20,18 +20,18 @@
|
|||||||
<spring-boot.version>2.5.15</spring-boot.version>
|
<spring-boot.version>2.5.15</spring-boot.version>
|
||||||
<shiro.version>1.13.0</shiro.version>
|
<shiro.version>1.13.0</shiro.version>
|
||||||
<thymeleaf.extras.shiro.version>2.1.0</thymeleaf.extras.shiro.version>
|
<thymeleaf.extras.shiro.version>2.1.0</thymeleaf.extras.shiro.version>
|
||||||
<druid.version>1.2.23</druid.version>
|
<druid.version>1.2.27</druid.version>
|
||||||
<bitwalker.version>1.21</bitwalker.version>
|
<bitwalker.version>1.21</bitwalker.version>
|
||||||
<kaptcha.version>2.3.3</kaptcha.version>
|
<kaptcha.version>2.3.3</kaptcha.version>
|
||||||
<swagger.version>3.0.0</swagger.version>
|
<swagger.version>3.0.0</swagger.version>
|
||||||
<pagehelper.boot.version>1.4.7</pagehelper.boot.version>
|
<pagehelper.boot.version>1.4.7</pagehelper.boot.version>
|
||||||
<fastjson.version>1.2.83</fastjson.version>
|
<fastjson.version>1.2.83</fastjson.version>
|
||||||
<oshi.version>6.8.1</oshi.version>
|
<oshi.version>6.8.3</oshi.version>
|
||||||
<commons.io.version>2.19.0</commons.io.version>
|
<commons.io.version>2.19.0</commons.io.version>
|
||||||
<poi.version>4.1.2</poi.version>
|
<poi.version>4.1.2</poi.version>
|
||||||
<velocity.version>2.3</velocity.version>
|
<velocity.version>2.3</velocity.version>
|
||||||
<!-- override dependency version -->
|
<!-- override dependency version -->
|
||||||
<tomcat.version>9.0.105</tomcat.version>
|
<tomcat.version>9.0.108</tomcat.version>
|
||||||
<logback.version>1.2.13</logback.version>
|
<logback.version>1.2.13</logback.version>
|
||||||
<spring-framework.version>5.3.39</spring-framework.version>
|
<spring-framework.version>5.3.39</spring-framework.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
@@ -16,7 +16,6 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import com.ruoyi.common.config.RuoYiConfig;
|
import com.ruoyi.common.config.RuoYiConfig;
|
||||||
import com.ruoyi.common.config.ServerConfig;
|
import com.ruoyi.common.config.ServerConfig;
|
||||||
import com.ruoyi.common.constant.Constants;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||||
@@ -150,7 +149,7 @@ public class CommonController
|
|||||||
// 本地资源路径
|
// 本地资源路径
|
||||||
String localPath = RuoYiConfig.getProfile();
|
String localPath = RuoYiConfig.getProfile();
|
||||||
// 数据库资源地址
|
// 数据库资源地址
|
||||||
String downloadPath = localPath + StringUtils.substringAfter(resource, Constants.RESOURCE_PREFIX);
|
String downloadPath = localPath + FileUtils.stripPrefix(resource);
|
||||||
// 下载名称
|
// 下载名称
|
||||||
String downloadName = StringUtils.substringAfterLast(downloadPath, "/");
|
String downloadName = StringUtils.substringAfterLast(downloadPath, "/");
|
||||||
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
||||||
|
@@ -17,10 +17,10 @@ import com.ruoyi.common.core.controller.BaseController;
|
|||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
|
||||||
import com.ruoyi.common.utils.ShiroUtils;
|
import com.ruoyi.common.utils.ShiroUtils;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||||
|
import com.ruoyi.common.utils.file.FileUtils;
|
||||||
import com.ruoyi.common.utils.file.MimeTypeUtils;
|
import com.ruoyi.common.utils.file.MimeTypeUtils;
|
||||||
import com.ruoyi.framework.shiro.service.SysPasswordService;
|
import com.ruoyi.framework.shiro.service.SysPasswordService;
|
||||||
import com.ruoyi.system.service.ISysUserService;
|
import com.ruoyi.system.service.ISysUserService;
|
||||||
@@ -89,7 +89,6 @@ public class SysProfileController extends BaseController
|
|||||||
}
|
}
|
||||||
user.setSalt(ShiroUtils.randomSalt());
|
user.setSalt(ShiroUtils.randomSalt());
|
||||||
user.setPassword(passwordService.encryptPassword(user.getLoginName(), newPassword, user.getSalt()));
|
user.setPassword(passwordService.encryptPassword(user.getLoginName(), newPassword, user.getSalt()));
|
||||||
user.setPwdUpdateDate(DateUtils.getNowDate());
|
|
||||||
if (userService.resetUserPwd(user) > 0)
|
if (userService.resetUserPwd(user) > 0)
|
||||||
{
|
{
|
||||||
setSysUser(userService.selectUserById(user.getUserId()));
|
setSysUser(userService.selectUserById(user.getUserId()));
|
||||||
@@ -157,16 +156,21 @@ public class SysProfileController extends BaseController
|
|||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult updateAvatar(@RequestParam("avatarfile") MultipartFile file)
|
public AjaxResult updateAvatar(@RequestParam("avatarfile") MultipartFile file)
|
||||||
{
|
{
|
||||||
SysUser currentUser = getSysUser();
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!file.isEmpty())
|
if (!file.isEmpty())
|
||||||
{
|
{
|
||||||
String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION);
|
SysUser currentUser = getSysUser();
|
||||||
currentUser.setAvatar(avatar);
|
String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION, true);
|
||||||
if (userService.updateUserInfo(currentUser) > 0)
|
if (userService.updateUserAvatar(currentUser.getUserId(), avatar))
|
||||||
{
|
{
|
||||||
setSysUser(userService.selectUserById(currentUser.getUserId()));
|
String oldAvatar = currentUser.getAvatar();
|
||||||
|
if (StringUtils.isNotEmpty(oldAvatar))
|
||||||
|
{
|
||||||
|
FileUtils.deleteFile(RuoYiConfig.getProfile() + FileUtils.stripPrefix(oldAvatar));
|
||||||
|
}
|
||||||
|
currentUser.setAvatar(avatar);
|
||||||
|
setSysUser(currentUser);
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -20,7 +20,7 @@ Utils.assignIcons($.fn.bootstrapTable.icons, 'customViewOn', {
|
|||||||
})
|
})
|
||||||
|
|
||||||
Utils.assignIcons($.fn.bootstrapTable.icons, 'customViewOff', {
|
Utils.assignIcons($.fn.bootstrapTable.icons, 'customViewOff', {
|
||||||
glyphicon: 'glyphicon-thumbnails',
|
glyphicon: 'glyphicon glyphicon-eye-open',
|
||||||
fa: 'fa-th',
|
fa: 'fa-th',
|
||||||
bi: 'bi-grid',
|
bi: 'bi-grid',
|
||||||
icon: 'grid_on',
|
icon: 'grid_on',
|
||||||
|
@@ -119,9 +119,9 @@ body .layer-ext-moon .layui-layer-btn .layui-layer-btn1 {
|
|||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
body .layer-ext-moon .layui-layer-btn .layui-layer-btn2 {
|
body .layer-ext-moon .layui-layer-btn .layui-layer-btn2 {
|
||||||
background: #f60;
|
background: #fff;
|
||||||
color: #fff;
|
color: #404a58;
|
||||||
border: 1px solid #f60;
|
border: 1px solid #c0c4cd;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
body .layer-ext-moon .layui-layer-btn .layui-layer-btn3 {
|
body .layer-ext-moon .layui-layer-btn .layui-layer-btn3 {
|
||||||
|
@@ -476,6 +476,28 @@ body.body-small.fixed-sidebar.mini-navbar .navbar-static-side {
|
|||||||
top: 40px;
|
top: 40px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
background-color: #2f4050;
|
background-color: #2f4050;
|
||||||
|
max-height: 400px;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fixed-sidebar.mini-navbar .nav li:hover>.nav-second-level {
|
||||||
|
position: relative;
|
||||||
|
overflow-y: overlay;
|
||||||
|
scrollbar-width: thin;
|
||||||
|
scrollbar-color: #555 #2f4050;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fixed-sidebar.mini-navbar .nav li:hover>.nav-second-level::-webkit-scrollbar {
|
||||||
|
width: 8px;
|
||||||
|
background: transparent;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fixed-sidebar.mini-navbar .nav li:hover>.nav-second-level::-webkit-scrollbar-thumb {
|
||||||
|
background: #888;
|
||||||
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fixed-sidebar.mini-navbar .nav li:hover>.nav-second-level, .fixed-sidebar.mini-navbar .nav li:hover>a> span.nav-label {
|
.fixed-sidebar.mini-navbar .nav li:hover>.nav-second-level, .fixed-sidebar.mini-navbar .nav li:hover>a> span.nav-label {
|
||||||
@@ -7044,4 +7066,4 @@ nav .logo {
|
|||||||
top: 0px;
|
top: 0px;
|
||||||
z-index: 9998;
|
z-index: 9998;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
File diff suppressed because one or more lines are too long
@@ -12,7 +12,7 @@
|
|||||||
<!-- bootstrap-table 表格插件样式 -->
|
<!-- bootstrap-table 表格插件样式 -->
|
||||||
<link th:href="@{/ajax/libs/bootstrap-table/bootstrap-table.min.css?v=1.24.1}" rel="stylesheet"/>
|
<link th:href="@{/ajax/libs/bootstrap-table/bootstrap-table.min.css?v=1.24.1}" rel="stylesheet"/>
|
||||||
<link th:href="@{/css/animate.min.css?v=20210831}" rel="stylesheet"/>
|
<link th:href="@{/css/animate.min.css?v=20210831}" rel="stylesheet"/>
|
||||||
<link th:href="@{/css/style.min.css?v=20210831}" rel="stylesheet"/>
|
<link th:href="@{/css/style.min.css?v=20250731}" rel="stylesheet"/>
|
||||||
<link th:href="@{/ruoyi/css/ry-ui.css?v=4.8.1}" rel="stylesheet"/>
|
<link th:href="@{/ruoyi/css/ry-ui.css?v=4.8.1}" rel="stylesheet"/>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
@@ -438,7 +438,7 @@ $(function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* 过期密码提示 */
|
/* 过期密码提示 */
|
||||||
if([[${isPasswordExpired}]]) {
|
if(![[${isDefaultModifyPwd}]] && [[${isPasswordExpired}]]) {
|
||||||
layer.confirm("您的密码已过期,请尽快修改密码!", {
|
layer.confirm("您的密码已过期,请尽快修改密码!", {
|
||||||
icon: 0,
|
icon: 0,
|
||||||
title: "安全提示",
|
title: "安全提示",
|
||||||
|
@@ -374,7 +374,7 @@ $(function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* 过期密码提示 */
|
/* 过期密码提示 */
|
||||||
if([[${isPasswordExpired}]]) {
|
if(![[${isDefaultModifyPwd}]] && [[${isPasswordExpired}]]) {
|
||||||
layer.confirm("您的密码已过期,请尽快修改密码!", {
|
layer.confirm("您的密码已过期,请尽快修改密码!", {
|
||||||
icon: 0,
|
icon: 0,
|
||||||
title: "安全提示",
|
title: "安全提示",
|
||||||
|
@@ -67,7 +67,7 @@
|
|||||||
<div class="ibox-content">
|
<div class="ibox-content">
|
||||||
<p><i class="fa fa-send-o"></i> 官网:<a href="http://www.ruoyi.vip" target="_blank">http://www.ruoyi.vip</a>
|
<p><i class="fa fa-send-o"></i> 官网:<a href="http://www.ruoyi.vip" target="_blank">http://www.ruoyi.vip</a>
|
||||||
</p>
|
</p>
|
||||||
<p><i class="fa fa-qq"></i> QQ群:<s>满1389287</s> <s>满1679294</s> <s>满1529866</s> <s>满1772718</s> <s>满1366522</s> <s>满1382251</s> <s>满1145125</s> <s>满86752435</s> <s>满134072510</s> <s>满210336300</s> <s>满339522636</s> <s>满130035985</s> <s>满143151071</s> <s>满158781320</s> <s>满201531282</s> <s>满101526938</s> <s>满264355400</s> <s>满298522656</s> <s>满139845794</s> <s>满185760789</s> <s>满175104288</s> <s>满174942938</s> <s>满287843737</s> <s>满232896766</s> <a href="http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=XwhV8deuZXt__yteR1clNanVSXzA-ugq&authKey=ezgwKqEZPdP%2FgC9I03OBkJb%2Biii8yvVfwrcQuu0%2FL6ILXcRdHYDBFKCXeoeBT0E6&noverify=0&group_code=180208928" target="_blank">180208928</a>
|
<p><i class="fa fa-qq"></i> QQ群:<s>满1389287</s> <s>满1679294</s> <s>满1529866</s> <s>满1772718</s> <s>满1366522</s> <s>满1382251</s> <s>满1145125</s> <s>满86752435</s> <s>满134072510</s> <s>满210336300</s> <s>满339522636</s> <s>满130035985</s> <s>满143151071</s> <s>满158781320</s> <s>满201531282</s> <s>满101526938</s> <s>满264355400</s> <s>满298522656</s> <s>满139845794</s> <s>满185760789</s> <s>满175104288</s> <s>满174942938</s> <s>满287843737</s> <s>满232896766</s> <s>满180208928</s> <a href="http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=WqsGDxpGkqOPeWGOf3I32f_rXxdhqYNr&authKey=kvdF5df7PO9bzWxmixKhZN6ShsECBiuGUmmzTZBWVr2MVOfJ8%2F4oD0Gws0rbgYfz&noverify=0&group_code=140284548" target="_blank">140284548</a>
|
||||||
</p>
|
</p>
|
||||||
<p><i class="fa fa-weixin"></i> 微信:<a href="javascript:;">/ *若依</a>
|
<p><i class="fa fa-weixin"></i> 微信:<a href="javascript:;">/ *若依</a>
|
||||||
</p>
|
</p>
|
||||||
|
@@ -232,10 +232,17 @@
|
|||||||
var treeId = $("#treeId").val();
|
var treeId = $("#treeId").val();
|
||||||
var deptId = $.common.isEmpty(treeId) ? "100" : $("#treeId").val();
|
var deptId = $.common.isEmpty(treeId) ? "100" : $("#treeId").val();
|
||||||
var url = ctx + "system/user/selectDeptTree/" + deptId;
|
var url = ctx + "system/user/selectDeptTree/" + deptId;
|
||||||
|
var btn = ['<i class="fa fa-check"></i> 确认', '<i class="fa fa-trash-o"></i> 清除', '<i class="fa fa-close"></i> 关闭'];
|
||||||
var options = {
|
var options = {
|
||||||
title: '选择部门',
|
title: '选择部门',
|
||||||
width: "380",
|
width: "380",
|
||||||
url: url,
|
url: url,
|
||||||
|
btn: btn,
|
||||||
|
btn2: function(index, layero) {
|
||||||
|
$("#treeId").val("");
|
||||||
|
$("#treeName").val("");
|
||||||
|
$.modal.close(index);
|
||||||
|
},
|
||||||
callBack: doSubmit
|
callBack: doSubmit
|
||||||
};
|
};
|
||||||
$.modal.openOptions(options);
|
$.modal.openOptions(options);
|
||||||
|
@@ -198,10 +198,17 @@
|
|||||||
function selectDeptTree() {
|
function selectDeptTree() {
|
||||||
var deptId = $.common.isEmpty($("#treeId").val()) ? "100" : $("#treeId").val();
|
var deptId = $.common.isEmpty($("#treeId").val()) ? "100" : $("#treeId").val();
|
||||||
var url = ctx + "system/user/selectDeptTree/" + deptId;
|
var url = ctx + "system/user/selectDeptTree/" + deptId;
|
||||||
|
var btn = ['<i class="fa fa-check"></i> 确认', '<i class="fa fa-trash-o"></i> 清除', '<i class="fa fa-close"></i> 关闭'];
|
||||||
var options = {
|
var options = {
|
||||||
title: '选择部门',
|
title: '选择部门',
|
||||||
width: "380",
|
width: "380",
|
||||||
url: url,
|
url: url,
|
||||||
|
btn: btn,
|
||||||
|
btn2: function(index, layero) {
|
||||||
|
$("#treeId").val("");
|
||||||
|
$("#treeName").val("");
|
||||||
|
$.modal.close(index);
|
||||||
|
},
|
||||||
callBack: doSubmit
|
callBack: doSubmit
|
||||||
};
|
};
|
||||||
$.modal.openOptions(options);
|
$.modal.openOptions(options);
|
||||||
|
@@ -13,6 +13,7 @@ import com.ruoyi.common.exception.file.FileSizeLimitExceededException;
|
|||||||
import com.ruoyi.common.exception.file.InvalidExtensionException;
|
import com.ruoyi.common.exception.file.InvalidExtensionException;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.utils.uuid.IdUtils;
|
||||||
import com.ruoyi.common.utils.uuid.Seq;
|
import com.ruoyi.common.utils.uuid.Seq;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -101,6 +102,26 @@ public class FileUploadUtils
|
|||||||
public static final String upload(String baseDir, MultipartFile file, String[] allowedExtension)
|
public static final String upload(String baseDir, MultipartFile file, String[] allowedExtension)
|
||||||
throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException,
|
throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException,
|
||||||
InvalidExtensionException
|
InvalidExtensionException
|
||||||
|
{
|
||||||
|
return upload(baseDir, file, allowedExtension, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件上传
|
||||||
|
*
|
||||||
|
* @param baseDir 相对应用的基目录
|
||||||
|
* @param file 上传的文件
|
||||||
|
* @param useCustomNaming 系统自定义文件名
|
||||||
|
* @param allowedExtension 上传文件类型
|
||||||
|
* @return 返回上传成功的文件名
|
||||||
|
* @throws FileSizeLimitExceededException 如果超出最大大小
|
||||||
|
* @throws FileNameLengthLimitExceededException 文件名太长
|
||||||
|
* @throws IOException 比如读写文件出错时
|
||||||
|
* @throws InvalidExtensionException 文件校验异常
|
||||||
|
*/
|
||||||
|
public static final String upload(String baseDir, MultipartFile file, String[] allowedExtension, boolean useCustomNaming)
|
||||||
|
throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException,
|
||||||
|
InvalidExtensionException
|
||||||
{
|
{
|
||||||
int fileNameLength = Objects.requireNonNull(file.getOriginalFilename()).length();
|
int fileNameLength = Objects.requireNonNull(file.getOriginalFilename()).length();
|
||||||
if (fileNameLength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH)
|
if (fileNameLength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH)
|
||||||
@@ -110,7 +131,7 @@ public class FileUploadUtils
|
|||||||
|
|
||||||
assertAllowed(file, allowedExtension);
|
assertAllowed(file, allowedExtension);
|
||||||
|
|
||||||
String fileName = extractFilename(file);
|
String fileName = useCustomNaming ? uuidFilename(file) : extractFilename(file);
|
||||||
|
|
||||||
String absPath = getAbsoluteFile(baseDir, fileName).getAbsolutePath();
|
String absPath = getAbsoluteFile(baseDir, fileName).getAbsolutePath();
|
||||||
file.transferTo(Paths.get(absPath));
|
file.transferTo(Paths.get(absPath));
|
||||||
@@ -118,12 +139,19 @@ public class FileUploadUtils
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编码文件名
|
* 编码文件名(日期格式目录 + 原文件名 + 序列值 + 后缀)
|
||||||
*/
|
*/
|
||||||
public static final String extractFilename(MultipartFile file)
|
public static final String extractFilename(MultipartFile file)
|
||||||
{
|
{
|
||||||
return StringUtils.format("{}/{}_{}.{}", DateUtils.datePath(),
|
return StringUtils.format("{}/{}_{}.{}", DateUtils.datePath(), FilenameUtils.getBaseName(file.getOriginalFilename()), Seq.getId(Seq.uploadSeqType), getExtension(file));
|
||||||
FilenameUtils.getBaseName(file.getOriginalFilename()), Seq.getId(Seq.uploadSeqType), getExtension(file));
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编编码文件名(日期格式目录 + UUID + 后缀)
|
||||||
|
*/
|
||||||
|
public static final String uuidFilename(MultipartFile file)
|
||||||
|
{
|
||||||
|
return StringUtils.format("{}/{}.{}", DateUtils.datePath(), IdUtils.fastSimpleUUID(), getExtension(file));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException
|
public static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException
|
||||||
|
@@ -15,6 +15,7 @@ import org.apache.commons.io.FilenameUtils;
|
|||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
import com.ruoyi.common.config.RuoYiConfig;
|
import com.ruoyi.common.config.RuoYiConfig;
|
||||||
|
import com.ruoyi.common.constant.Constants;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.common.utils.uuid.IdUtils;
|
import com.ruoyi.common.utils.uuid.IdUtils;
|
||||||
@@ -103,6 +104,17 @@ public class FileUtils
|
|||||||
return FileUploadUtils.getPathFileName(uploadDir, pathName);
|
return FileUploadUtils.getPathFileName(uploadDir, pathName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 移除路径中的请求前缀片段
|
||||||
|
*
|
||||||
|
* @param filePath 文件路径
|
||||||
|
* @return 移除后的文件路径
|
||||||
|
*/
|
||||||
|
public static String stripPrefix(String filePath)
|
||||||
|
{
|
||||||
|
return StringUtils.substringAfter(filePath, Constants.RESOURCE_PREFIX);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除文件
|
* 删除文件
|
||||||
*
|
*
|
||||||
@@ -288,4 +300,3 @@ public class FileUtils
|
|||||||
return baseName;
|
return baseName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -186,11 +186,6 @@ public class ExcelUtil<T>
|
|||||||
*/
|
*/
|
||||||
private Map<Integer, Double> statistics = new HashMap<Integer, Double>();
|
private Map<Integer, Double> statistics = new HashMap<Integer, Double>();
|
||||||
|
|
||||||
/**
|
|
||||||
* 数字格式
|
|
||||||
*/
|
|
||||||
private static final DecimalFormat DOUBLE_FORMAT = new DecimalFormat("######0.00");
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 实体对象
|
* 实体对象
|
||||||
*/
|
*/
|
||||||
@@ -861,6 +856,7 @@ public class ExcelUtil<T>
|
|||||||
style = wb.createCellStyle();
|
style = wb.createCellStyle();
|
||||||
style.setAlignment(HorizontalAlignment.CENTER);
|
style.setAlignment(HorizontalAlignment.CENTER);
|
||||||
style.setVerticalAlignment(VerticalAlignment.CENTER);
|
style.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||||
|
style.setDataFormat(dataFormat.getFormat("######0.00"));
|
||||||
Font totalFont = wb.createFont();
|
Font totalFont = wb.createFont();
|
||||||
totalFont.setFontName("Arial");
|
totalFont.setFontName("Arial");
|
||||||
totalFont.setFontHeightInPoints((short) 10);
|
totalFont.setFontHeightInPoints((short) 10);
|
||||||
@@ -1442,7 +1438,7 @@ public class ExcelUtil<T>
|
|||||||
{
|
{
|
||||||
cell = row.createCell(key);
|
cell = row.createCell(key);
|
||||||
cell.setCellStyle(styles.get("total"));
|
cell.setCellStyle(styles.get("total"));
|
||||||
cell.setCellValue(DOUBLE_FORMAT.format(statistics.get(key)));
|
cell.setCellValue(statistics.get(key));
|
||||||
}
|
}
|
||||||
statistics.clear();
|
statistics.clear();
|
||||||
}
|
}
|
||||||
|
@@ -179,10 +179,6 @@ public class SysLoginService
|
|||||||
*/
|
*/
|
||||||
public void recordLoginInfo(Long userId)
|
public void recordLoginInfo(Long userId)
|
||||||
{
|
{
|
||||||
SysUser user = new SysUser();
|
userService.updateLoginInfo(userId, ShiroUtils.getIp(), DateUtils.getNowDate());
|
||||||
user.setUserId(userId);
|
|
||||||
user.setLoginIp(ShiroUtils.getIp());
|
|
||||||
user.setLoginDate(DateUtils.getNowDate());
|
|
||||||
userService.updateUserInfo(user);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -131,11 +131,11 @@ public class ScheduleUtils
|
|||||||
int count = StringUtils.countMatches(packageName, ".");
|
int count = StringUtils.countMatches(packageName, ".");
|
||||||
if (count > 1)
|
if (count > 1)
|
||||||
{
|
{
|
||||||
return StringUtils.containsAnyIgnoreCase(invokeTarget, Constants.JOB_WHITELIST_STR);
|
return StringUtils.startsWithAny(invokeTarget, Constants.JOB_WHITELIST_STR);
|
||||||
}
|
}
|
||||||
Object obj = SpringUtils.getBean(StringUtils.split(invokeTarget, ".")[0]);
|
Object obj = SpringUtils.getBean(StringUtils.split(invokeTarget, ".")[0]);
|
||||||
String beanPackageName = obj.getClass().getPackage().getName();
|
String beanPackageName = obj.getClass().getPackage().getName();
|
||||||
return StringUtils.containsAnyIgnoreCase(beanPackageName, Constants.JOB_WHITELIST_STR)
|
return StringUtils.startsWithAny(beanPackageName, Constants.JOB_WHITELIST_STR)
|
||||||
&& !StringUtils.containsAnyIgnoreCase(beanPackageName, Constants.JOB_ERROR_STR);
|
&& !StringUtils.startsWithAny(beanPackageName, Constants.JOB_ERROR_STR);
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,6 +1,8 @@
|
|||||||
package com.ruoyi.system.mapper;
|
package com.ruoyi.system.mapper;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -90,6 +92,44 @@ public interface SysUserMapper
|
|||||||
*/
|
*/
|
||||||
public int updateUser(SysUser user);
|
public int updateUser(SysUser user);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户头像
|
||||||
|
*
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @param avatar 头像地址
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateUserAvatar(@Param("userId") Long userId, @Param("avatar") String avatar);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户状态
|
||||||
|
*
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @param status 状态
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateUserStatus(@Param("userId") Long userId, @Param("status") String status);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重置用户密码
|
||||||
|
*
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @param password 密码
|
||||||
|
* @param salt 盐
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int resetUserPwd(@Param("userId") Long userId, @Param("password") String password, @Param("salt") String salt);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新用户登录信息(IP和登录时间)
|
||||||
|
*
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @param loginIp 登录IP地址
|
||||||
|
* @param loginDate 登录时间
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateLoginInfo(@Param("userId") Long userId, @Param("loginIp") String loginIp, @Param("loginDate") Date loginDate);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增用户信息
|
* 新增用户信息
|
||||||
*
|
*
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
package com.ruoyi.system.service;
|
package com.ruoyi.system.service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||||
import com.ruoyi.system.domain.SysUserRole;
|
import com.ruoyi.system.domain.SysUserRole;
|
||||||
@@ -124,6 +125,25 @@ public interface ISysUserService
|
|||||||
*/
|
*/
|
||||||
public int updateUserInfo(SysUser user);
|
public int updateUserInfo(SysUser user);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户头像
|
||||||
|
*
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @param avatar 头像地址
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public boolean updateUserAvatar(Long userId, String avatar);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新用户登录信息(IP和登录时间)
|
||||||
|
*
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @param loginIp 登录IP地址
|
||||||
|
* @param loginDate 登录时间
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public void updateLoginInfo(Long userId, String loginIp, Date loginDate);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户授权角色
|
* 用户授权角色
|
||||||
*
|
*
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
package com.ruoyi.system.service.impl;
|
package com.ruoyi.system.service.impl;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import javax.validation.ConstraintViolationException;
|
import javax.validation.ConstraintViolationException;
|
||||||
@@ -275,6 +276,31 @@ public class SysUserServiceImpl implements ISysUserService
|
|||||||
return userMapper.updateUser(user);
|
return userMapper.updateUser(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户头像
|
||||||
|
*
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @param avatar 头像地址
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public boolean updateUserAvatar(Long userId, String avatar)
|
||||||
|
{
|
||||||
|
return userMapper.updateUserAvatar(userId, avatar) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新用户登录信息(IP和登录时间)
|
||||||
|
*
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @param loginIp 登录IP地址
|
||||||
|
* @param loginDate 登录时间
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public void updateLoginInfo(Long userId, String loginIp, Date loginDate)
|
||||||
|
{
|
||||||
|
userMapper.updateLoginInfo(userId, loginIp, loginDate);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户授权角色
|
* 用户授权角色
|
||||||
*
|
*
|
||||||
@@ -298,7 +324,7 @@ public class SysUserServiceImpl implements ISysUserService
|
|||||||
@Override
|
@Override
|
||||||
public int resetUserPwd(SysUser user)
|
public int resetUserPwd(SysUser user)
|
||||||
{
|
{
|
||||||
return updateUserInfo(user);
|
return userMapper.resetUserPwd(user.getUserId(), user.getPassword(), user.getSalt());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -518,6 +544,7 @@ public class SysUserServiceImpl implements ISysUserService
|
|||||||
checkUserDataScope(u.getUserId());
|
checkUserDataScope(u.getUserId());
|
||||||
deptService.checkDeptDataScope(user.getDeptId());
|
deptService.checkDeptDataScope(user.getDeptId());
|
||||||
user.setUserId(u.getUserId());
|
user.setUserId(u.getUserId());
|
||||||
|
user.setDeptId(u.getDeptId());
|
||||||
user.setUpdateBy(operName);
|
user.setUpdateBy(operName);
|
||||||
userMapper.updateUser(user);
|
userMapper.updateUser(user);
|
||||||
successNum++;
|
successNum++;
|
||||||
@@ -563,6 +590,6 @@ public class SysUserServiceImpl implements ISysUserService
|
|||||||
@Override
|
@Override
|
||||||
public int changeStatus(SysUser user)
|
public int changeStatus(SysUser user)
|
||||||
{
|
{
|
||||||
return userMapper.updateUser(user);
|
return userMapper.updateUserStatus(user.getUserId(), user.getStatus());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -166,10 +166,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<update id="updateUserAvatar" parameterType="SysUser">
|
||||||
|
update sys_user set avatar = #{avatar} where user_id = #{userId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="resetUserPwd" parameterType="SysUser">
|
||||||
|
update sys_user SET pwd_update_date = sysdate(), password = #{password}, salt = #{salt}, update_time = sysdate() where user_id = #{userId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="updateUserStatus" parameterType="SysUser">
|
||||||
|
update sys_user SET status = #{status}, update_time = sysdate() where user_id = #{userId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="updateLoginInfo" parameterType="SysUser">
|
||||||
|
update sys_user set login_ip = #{loginIp}, login_date = #{loginDate} where user_id = #{userId}
|
||||||
|
</update>
|
||||||
|
|
||||||
<update id="updateUser" parameterType="SysUser">
|
<update id="updateUser" parameterType="SysUser">
|
||||||
update sys_user
|
update sys_user
|
||||||
<set>
|
<set>
|
||||||
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
|
<if test="deptId != 0">dept_id = #{deptId},</if>
|
||||||
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
||||||
<if test="userType != null and userType != ''">user_type = #{userType},</if>
|
<if test="userType != null and userType != ''">user_type = #{userType},</if>
|
||||||
<if test="email != null and email != ''">email = #{email},</if>
|
<if test="email != null and email != ''">email = #{email},</if>
|
||||||
|
Reference in New Issue
Block a user