修正 部分注释
修正 移动端图片预览自适应大小 修正 添加用户时,浏览器会自动填入浏览器记住的用户名和密码 修正 部门删除后重新添加会提示已存在 完善 删除用户统一修改为 逻辑删除 完善 统一代码风格
This commit is contained in:
parent
5c736e96c9
commit
99f5fe5580
2
pom.xml
2
pom.xml
|
|
@ -67,7 +67,7 @@
|
|||
<version>${shiro.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Shiro使用Srping框架 -->
|
||||
<!-- Shiro使用Spring框架 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.shiro</groupId>
|
||||
<artifactId>shiro-spring</artifactId>
|
||||
|
|
|
|||
|
|
@ -4,13 +4,14 @@
|
|||
<!-- 磁盘缓存位置 -->
|
||||
<diskStore path="java.io.tmpdir"/>
|
||||
|
||||
<!-- maxEntriesLocalHeap:堆内存中最大缓存对象数,0没有限制 -->
|
||||
<!-- maxElementsInMemory: 在内存中缓存的element的最大数目。-->
|
||||
<!-- eternal:elements是否永久有效,如果为true,timeouts将被忽略,element将永不过期 -->
|
||||
<!-- timeToIdleSeconds:失效前的空闲秒数,当eternal为false时,这个属性才有效,0为不限制 -->
|
||||
<!-- timeToLiveSeconds:失效前的存活秒数,创建时间到失效时间的间隔为存活时间,当eternal为false时,这个属性才有效,0为不限制 -->
|
||||
<!-- overflowToDisk: 如果内存中数据超过内存限制,是否要缓存到磁盘上 -->
|
||||
<!-- maxEntriesLocalHeap: 堆内存中最大缓存对象数,0没有限制 -->
|
||||
<!-- maxElementsInMemory:在内存中缓存的element的最大数目。-->
|
||||
<!-- eternal: elements是否永久有效,如果为true,timeouts将被忽略,element将永不过期 -->
|
||||
<!-- timeToIdleSeconds: 失效前的空闲秒数,当eternal为false时,这个属性才有效,0为不限制 -->
|
||||
<!-- timeToLiveSeconds: 失效前的存活秒数,创建时间到失效时间的间隔为存活时间,当eternal为false时,这个属性才有效,0为不限制 -->
|
||||
<!-- overflowToDisk:如果内存中数据超过内存限制,是否要缓存到磁盘上 -->
|
||||
<!-- statistics:是否收集统计信息。如果需要监控缓存使用情况,应该打开这个选项。默认为关闭(统计会影响性能)。设置statistics="true"开启统计 -->
|
||||
<!-- diskPersistent:是否持久化磁盘缓存,当这个属性的值为true时,系统在初始化时会在磁盘中查找文件名为cache名称,后缀名为data的文件。指重启jvm后,数据是否有效。默认为false -->
|
||||
|
||||
<!-- 默认缓存 -->
|
||||
<defaultCache
|
||||
|
|
|
|||
|
|
@ -3083,10 +3083,6 @@ a:hover, a:focus {
|
|||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
video {
|
||||
width: 100% !important;
|
||||
height: auto !important;
|
||||
}
|
||||
/* GALLERY */
|
||||
.gallery>.row>div {
|
||||
margin-bottom: 15px;
|
||||
|
|
|
|||
|
|
@ -215,9 +215,15 @@ var table = {
|
|||
$(optionsIds).off("click").on("click", '.img-circle', function() {
|
||||
var src = $(this).attr('src');
|
||||
var target = $(this).data('target');
|
||||
if($.common.equals("self", target)) {
|
||||
var height = $(this).data('height');
|
||||
var width = $(this).data('width');
|
||||
if($.common.equals("self", target)) {
|
||||
//如果是移动端,就使用自适应大小弹窗
|
||||
if ($.common.isMobile()) {
|
||||
width = 'auto';
|
||||
height = 'auto';
|
||||
}
|
||||
|
||||
layer.open({
|
||||
title: false,
|
||||
type: 1,
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ function login() {
|
|||
data: {
|
||||
"username": username,
|
||||
"password": password,
|
||||
"validateCode" : validateCode,
|
||||
"validateCode": validateCode,
|
||||
"rememberMe": rememberMe
|
||||
},
|
||||
success: function(r) {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
<head th:fragment=header(title)>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="keywords" content="">
|
||||
<meta name="description" content="">
|
||||
<title th:text="${title}"></title>
|
||||
|
|
|
|||
|
|
@ -5,9 +5,8 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="renderer" content="webkit">
|
||||
<title>若依系统首页</title>
|
||||
<!--[if lt IE 9]>
|
||||
<meta http-equiv="refresh" content="0;ie.html"/>
|
||||
<![endif]-->
|
||||
<!-- 避免IE使用兼容模式 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<link th:href="@{favicon.ico}" rel="stylesheet"/>
|
||||
<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
|
||||
<link th:href="@{/css/jquery.contextMenu.min.css}" rel="stylesheet"/>
|
||||
|
|
@ -276,14 +275,15 @@ function resetPwd() {
|
|||
var url = ctx + 'system/user/profile/resetPwd';
|
||||
$.modal.open("重置密码", url, '770', '380');
|
||||
}
|
||||
|
||||
/* 切换主题 */
|
||||
function switchSkin() {
|
||||
layer.open({
|
||||
type : 2,
|
||||
shadeClose : true,
|
||||
title : "切换主题",
|
||||
area : ["530px", "386px"],
|
||||
content : [ctx + "system/switchSkin", 'no']
|
||||
type: 2,
|
||||
shadeClose: true,
|
||||
title: "切换主题",
|
||||
area: ["530px", "386px"],
|
||||
content: [ctx + "system/switchSkin", 'no']
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -108,7 +108,10 @@
|
|||
},
|
||||
{
|
||||
field: 'remark',
|
||||
title: '备注'
|
||||
title: '备注',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.tooltip(value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label is-required">用户名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="userName" placeholder="请输入用户名称" class="form-control" type="text" maxlength="30" required>
|
||||
<input name="userName" placeholder="请输入用户名称" class="form-control" type="text" maxlength="30" autocomplete="new-password" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -61,7 +61,7 @@
|
|||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label is-required">登录密码:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="password" placeholder="请输入登录密码" class="form-control" type="password" th:value="${@config.getKey('sys.user.initPassword')}" required>
|
||||
<input name="password" placeholder="请输入登录密码" class="form-control" type="password" th:value="${@config.getKey('sys.user.initPassword')}" autocomplete="new-password" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -20,22 +20,22 @@ public interface ShiroConstants
|
|||
/**
|
||||
* 消息key
|
||||
*/
|
||||
public static String MESSAGE = "message";
|
||||
public static final String MESSAGE = "message";
|
||||
|
||||
/**
|
||||
* 错误key
|
||||
*/
|
||||
public static String ERROR = "errorMsg";
|
||||
public static final String ERROR = "errorMsg";
|
||||
|
||||
/**
|
||||
* 编码格式
|
||||
*/
|
||||
public static String ENCODING = "UTF-8";
|
||||
public static final String ENCODING = "UTF-8";
|
||||
|
||||
/**
|
||||
* 当前在线会话
|
||||
*/
|
||||
public String ONLINE_SESSION = "online_session";
|
||||
public static final String ONLINE_SESSION = "online_session";
|
||||
|
||||
/**
|
||||
* 验证码key
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ public class FileUploadUtils
|
|||
*
|
||||
* @param baseDir 相对应用的基目录
|
||||
* @param file 上传的文件
|
||||
* @param extension 上传文件类型
|
||||
* @param allowedExtension 上传文件类型
|
||||
* @return 返回上传成功的文件名
|
||||
* @throws FileSizeLimitExceededException 如果超出最大大小
|
||||
* @throws FileNameLengthLimitExceededException 文件名太长
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@ import com.ruoyi.common.utils.StringUtils;
|
|||
*/
|
||||
public class EscapeUtil
|
||||
{
|
||||
public static final String RE_HTML_MARK = "(<[^<]*?>)|(<[\\s]*?/[^<]*?>)|(<[^<]*?/[\\s]*?>)";
|
||||
|
||||
private static final char[][] TEXT = new char[64][];
|
||||
|
||||
static
|
||||
|
|
@ -141,14 +139,4 @@ public class EscapeUtil
|
|||
}
|
||||
return tmp.toString();
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
String html = "<script>alert(1);</script>";
|
||||
// String html = "<scr<script>ipt>alert(\"XSS\")</scr<script>ipt>";
|
||||
// String html = "<123";
|
||||
System.out.println(EscapeUtil.clean(html));
|
||||
System.out.println(EscapeUtil.escape(html));
|
||||
System.out.println(EscapeUtil.unescape(html));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,7 +92,8 @@ public class DataScopeAspect
|
|||
*
|
||||
* @param joinPoint 切点
|
||||
* @param user 用户
|
||||
* @param alias 别名
|
||||
* @param deptAlias 别名
|
||||
* @param userAlias 别名
|
||||
*/
|
||||
public static void dataScopeFilter(JoinPoint joinPoint, SysUser user, String deptAlias, String userAlias)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ public abstract class RepeatSubmitInterceptor extends HandlerInterceptorAdapter
|
|||
/**
|
||||
* 验证是否重复提交由子类实现具体的防重复提交的规则
|
||||
*
|
||||
* @param httpServletRequest
|
||||
* @param request
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ public class SysPasswordService
|
|||
|
||||
public String encryptPassword(String username, String password, String salt)
|
||||
{
|
||||
return new Md5Hash(username + password + salt).toHex().toString();
|
||||
return new Md5Hash(username + password + salt).toHex();
|
||||
}
|
||||
|
||||
public void unlock(String loginName){
|
||||
|
|
|
|||
|
|
@ -80,12 +80,12 @@ public class OnlineSessionDAO extends EnterpriseCacheSessionDAO
|
|||
boolean isGuest = onlineSession.getUserId() == null || onlineSession.getUserId() == 0L;
|
||||
|
||||
// session 数据变更了 同步
|
||||
if (isGuest == false && onlineSession.isAttributeChanged())
|
||||
if (!isGuest && onlineSession.isAttributeChanged())
|
||||
{
|
||||
needSync = true;
|
||||
}
|
||||
|
||||
if (needSync == false)
|
||||
if (!needSync)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ public class ConfigService
|
|||
/**
|
||||
* 根据键名查询参数配置信息
|
||||
*
|
||||
* @param configName 参数名称
|
||||
* @param configKey 参数名称
|
||||
* @return 参数键值
|
||||
*/
|
||||
public String getKey(String configKey)
|
||||
|
|
|
|||
|
|
@ -115,8 +115,8 @@
|
|||
#if($column.pk)
|
||||
#elseif($column.list && "" != $dictType)
|
||||
{
|
||||
field : '${javaField}',
|
||||
title : '${comment}',
|
||||
field: '${javaField}',
|
||||
title: '${comment}',
|
||||
align: 'left',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(${javaField}Datas, value);
|
||||
|
|
@ -124,8 +124,8 @@
|
|||
},
|
||||
#elseif($column.list && "" != $javaField)
|
||||
{
|
||||
field : '${javaField}',
|
||||
title : '${comment}',
|
||||
field: '${javaField}',
|
||||
title: '${comment}',
|
||||
align: 'left'
|
||||
},
|
||||
#end
|
||||
|
|
|
|||
|
|
@ -111,22 +111,22 @@
|
|||
#end
|
||||
#if($column.pk)
|
||||
{
|
||||
field : '${javaField}',
|
||||
title : '${comment}',
|
||||
field: '${javaField}',
|
||||
title: '${comment}',
|
||||
visible: false
|
||||
},
|
||||
#elseif($column.list && "" != $dictType)
|
||||
{
|
||||
field : '${javaField}',
|
||||
title : '${comment}',
|
||||
field: '${javaField}',
|
||||
title: '${comment}',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(${javaField}Datas, value);
|
||||
}
|
||||
},
|
||||
#elseif($column.list && "" != $javaField)
|
||||
{
|
||||
field : '${javaField}',
|
||||
title : '${comment}'
|
||||
field: '${javaField}',
|
||||
title: '${comment}'
|
||||
},
|
||||
#end
|
||||
#end
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ public class JobInvokeUtil
|
|||
/**
|
||||
* 校验是否为为class包名
|
||||
*
|
||||
* @param str 名称
|
||||
* @param invokeTarget 名称
|
||||
* @return true是 false否
|
||||
*/
|
||||
public static boolean isValidClassName(String invokeTarget)
|
||||
|
|
|
|||
|
|
@ -177,6 +177,7 @@ public class SysRole extends BaseEntity
|
|||
this.deptIds = deptIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("roleId", getRoleId())
|
||||
|
|
|
|||
|
|
@ -346,6 +346,7 @@ public class SysUser extends BaseEntity
|
|||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.append("dept", getDept())
|
||||
.append("roles", getRoles())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -307,7 +307,7 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
}
|
||||
|
||||
/**
|
||||
* 校验用户名称是否唯一
|
||||
* 校验手机号是否唯一
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @return
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by d.parent_id, d.order_num
|
||||
|
|
@ -65,7 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="checkDeptNameUnique" resultMap="SysDeptResult">
|
||||
<include refid="selectDeptVo"/>
|
||||
where dept_name=#{deptName} and parent_id = #{parentId}
|
||||
where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
|
||||
|
|
|
|||
|
|
@ -131,13 +131,13 @@
|
|||
<if test="menuName != null and menuName != ''">menu_name = #{menuName},</if>
|
||||
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
|
||||
<if test="orderNum != null and orderNum != ''">order_num = #{orderNum},</if>
|
||||
<if test="url != null and url != ''">url = #{url},</if>
|
||||
<if test="url != null">url = #{url},</if>
|
||||
<if test="target != null and target != ''">target = #{target},</if>
|
||||
<if test="menuType != null and menuType != ''">menu_type = #{menuType},</if>
|
||||
<if test="visible != null">visible = #{visible},</if>
|
||||
<if test="perms !=null">perms = #{perms},</if>
|
||||
<if test="icon !=null and icon != ''">icon = #{icon},</if>
|
||||
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
|
|
|
|||
|
|
@ -119,29 +119,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="selectUserByLoginName" parameterType="String" resultMap="SysUserResult">
|
||||
<include refid="selectUserVo"/>
|
||||
where u.login_name = #{userName}
|
||||
where u.login_name = #{userName} and u.del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectUserByPhoneNumber" parameterType="String" resultMap="SysUserResult">
|
||||
<include refid="selectUserVo"/>
|
||||
where u.phonenumber = #{phonenumber}
|
||||
where u.phonenumber = #{phonenumber} and u.del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectUserByEmail" parameterType="String" resultMap="SysUserResult">
|
||||
<include refid="selectUserVo"/>
|
||||
where u.email = #{email}
|
||||
where u.email = #{email} and u.del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="checkLoginNameUnique" parameterType="String" resultType="int">
|
||||
select count(1) from sys_user where login_name=#{loginName}
|
||||
select count(1) from sys_user where login_name=#{loginName} and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
|
||||
select user_id, phonenumber from sys_user where phonenumber=#{phonenumber}
|
||||
select user_id, phonenumber from sys_user where phonenumber=#{phonenumber} and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
|
||||
select user_id, email from sys_user where email=#{email}
|
||||
select user_id, email from sys_user where email=#{email} and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
|
||||
|
|
@ -150,7 +150,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<delete id="deleteUserById" parameterType="Long">
|
||||
delete from sys_user where user_id = #{userId}
|
||||
update sys_user set del_flag = '2' where user_id = #{userId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteUserByIds" parameterType="Long">
|
||||
|
|
|
|||
Loading…
Reference in New Issue