修正 部分注释

修正 移动端图片预览自适应大小
修正 添加用户时,浏览器会自动填入浏览器记住的用户名和密码
修正 部门删除后重新添加会提示已存在
完善 删除用户统一修改为 逻辑删除
完善 统一代码风格
This commit is contained in:
li_oxen 2020-03-21 12:20:05 +08:00
parent 5c736e96c9
commit 99f5fe5580
27 changed files with 74 additions and 75 deletions

View File

@ -67,7 +67,7 @@
<version>${shiro.version}</version> <version>${shiro.version}</version>
</dependency> </dependency>
<!-- Shiro使用Srping框架 --> <!-- Shiro使用Spring框架 -->
<dependency> <dependency>
<groupId>org.apache.shiro</groupId> <groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring</artifactId> <artifactId>shiro-spring</artifactId>

View File

@ -11,6 +11,7 @@
<!-- timeToLiveSeconds: 失效前的存活秒数创建时间到失效时间的间隔为存活时间当eternal为false时这个属性才有效0为不限制 --> <!-- timeToLiveSeconds: 失效前的存活秒数创建时间到失效时间的间隔为存活时间当eternal为false时这个属性才有效0为不限制 -->
<!-- overflowToDisk如果内存中数据超过内存限制是否要缓存到磁盘上 --> <!-- overflowToDisk如果内存中数据超过内存限制是否要缓存到磁盘上 -->
<!-- statistics是否收集统计信息。如果需要监控缓存使用情况应该打开这个选项。默认为关闭统计会影响性能。设置statistics="true"开启统计 --> <!-- statistics是否收集统计信息。如果需要监控缓存使用情况应该打开这个选项。默认为关闭统计会影响性能。设置statistics="true"开启统计 -->
<!-- diskPersistent是否持久化磁盘缓存,当这个属性的值为true时,系统在初始化时会在磁盘中查找文件名为cache名称,后缀名为data的文件。指重启jvm后数据是否有效。默认为false -->
<!-- 默认缓存 --> <!-- 默认缓存 -->
<defaultCache <defaultCache

View File

@ -3083,10 +3083,6 @@ a:hover, a:focus {
margin-bottom: 15px; margin-bottom: 15px;
} }
video {
width: 100% !important;
height: auto !important;
}
/* GALLERY */ /* GALLERY */
.gallery>.row>div { .gallery>.row>div {
margin-bottom: 15px; margin-bottom: 15px;

View File

@ -215,9 +215,15 @@ var table = {
$(optionsIds).off("click").on("click", '.img-circle', function() { $(optionsIds).off("click").on("click", '.img-circle', function() {
var src = $(this).attr('src'); var src = $(this).attr('src');
var target = $(this).data('target'); var target = $(this).data('target');
if($.common.equals("self", target)) {
var height = $(this).data('height'); var height = $(this).data('height');
var width = $(this).data('width'); var width = $(this).data('width');
if($.common.equals("self", target)) { //如果是移动端,就使用自适应大小弹窗
if ($.common.isMobile()) {
width = 'auto';
height = 'auto';
}
layer.open({ layer.open({
title: false, title: false,
type: 1, type: 1,

View File

@ -2,6 +2,7 @@
<head th:fragment=header(title)> <head th:fragment=header(title)>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <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="keywords" content="">
<meta name="description" content=""> <meta name="description" content="">
<title th:text="${title}"></title> <title th:text="${title}"></title>

View File

@ -5,9 +5,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="renderer" content="webkit"> <meta name="renderer" content="webkit">
<title>若依系统首页</title> <title>若依系统首页</title>
<!--[if lt IE 9]> <!-- 避免IE使用兼容模式 -->
<meta http-equiv="refresh" content="0;ie.html"/> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<![endif]-->
<link th:href="@{favicon.ico}" rel="stylesheet"/> <link th:href="@{favicon.ico}" rel="stylesheet"/>
<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/> <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
<link th:href="@{/css/jquery.contextMenu.min.css}" rel="stylesheet"/> <link th:href="@{/css/jquery.contextMenu.min.css}" rel="stylesheet"/>
@ -276,6 +275,7 @@ function resetPwd() {
var url = ctx + 'system/user/profile/resetPwd'; var url = ctx + 'system/user/profile/resetPwd';
$.modal.open("重置密码", url, '770', '380'); $.modal.open("重置密码", url, '770', '380');
} }
/* 切换主题 */ /* 切换主题 */
function switchSkin() { function switchSkin() {
layer.open({ layer.open({

View File

@ -108,7 +108,10 @@
}, },
{ {
field: 'remark', field: 'remark',
title: '备注' title: '备注',
formatter: function(value, row, index) {
return $.table.tooltip(value);
}
}, },
{ {
field: 'createTime', field: 'createTime',

View File

@ -14,7 +14,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label is-required">用户名称:</label> <label class="col-sm-4 control-label is-required">用户名称:</label>
<div class="col-sm-8"> <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> </div>
</div> </div>
@ -61,7 +61,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label is-required">登录密码:</label> <label class="col-sm-4 control-label is-required">登录密码:</label>
<div class="col-sm-8"> <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> </div>
</div> </div>

View File

@ -20,22 +20,22 @@ public interface ShiroConstants
/** /**
* 消息key * 消息key
*/ */
public static String MESSAGE = "message"; public static final String MESSAGE = "message";
/** /**
* 错误key * 错误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 * 验证码key

View File

@ -91,7 +91,7 @@ public class FileUploadUtils
* *
* @param baseDir 相对应用的基目录 * @param baseDir 相对应用的基目录
* @param file 上传的文件 * @param file 上传的文件
* @param extension 上传文件类型 * @param allowedExtension 上传文件类型
* @return 返回上传成功的文件名 * @return 返回上传成功的文件名
* @throws FileSizeLimitExceededException 如果超出最大大小 * @throws FileSizeLimitExceededException 如果超出最大大小
* @throws FileNameLengthLimitExceededException 文件名太长 * @throws FileNameLengthLimitExceededException 文件名太长

View File

@ -9,8 +9,6 @@ import com.ruoyi.common.utils.StringUtils;
*/ */
public class EscapeUtil public class EscapeUtil
{ {
public static final String RE_HTML_MARK = "(<[^<]*?>)|(<[\\s]*?/[^<]*?>)|(<[^<]*?/[\\s]*?>)";
private static final char[][] TEXT = new char[64][]; private static final char[][] TEXT = new char[64][];
static static
@ -141,14 +139,4 @@ public class EscapeUtil
} }
return tmp.toString(); 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));
}
} }

View File

@ -92,7 +92,8 @@ public class DataScopeAspect
* *
* @param joinPoint 切点 * @param joinPoint 切点
* @param user 用户 * @param user 用户
* @param alias 别名 * @param deptAlias 别名
* @param userAlias 别名
*/ */
public static void dataScopeFilter(JoinPoint joinPoint, SysUser user, String deptAlias, String userAlias) public static void dataScopeFilter(JoinPoint joinPoint, SysUser user, String deptAlias, String userAlias)
{ {

View File

@ -47,7 +47,7 @@ public abstract class RepeatSubmitInterceptor extends HandlerInterceptorAdapter
/** /**
* 验证是否重复提交由子类实现具体的防重复提交的规则 * 验证是否重复提交由子类实现具体的防重复提交的规则
* *
* @param httpServletRequest * @param request
* @return * @return
* @throws Exception * @throws Exception
*/ */

View File

@ -80,7 +80,7 @@ public class SysPasswordService
public String encryptPassword(String username, String password, String salt) 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){ public void unlock(String loginName){

View File

@ -80,12 +80,12 @@ public class OnlineSessionDAO extends EnterpriseCacheSessionDAO
boolean isGuest = onlineSession.getUserId() == null || onlineSession.getUserId() == 0L; boolean isGuest = onlineSession.getUserId() == null || onlineSession.getUserId() == 0L;
// session 数据变更了 同步 // session 数据变更了 同步
if (isGuest == false && onlineSession.isAttributeChanged()) if (!isGuest && onlineSession.isAttributeChanged())
{ {
needSync = true; needSync = true;
} }
if (needSync == false) if (!needSync)
{ {
return; return;
} }

View File

@ -18,7 +18,7 @@ public class ConfigService
/** /**
* 根据键名查询参数配置信息 * 根据键名查询参数配置信息
* *
* @param configName 参数名称 * @param configKey 参数名称
* @return 参数键值 * @return 参数键值
*/ */
public String getKey(String configKey) public String getKey(String configKey)

View File

@ -65,7 +65,7 @@ public class JobInvokeUtil
/** /**
* 校验是否为为class包名 * 校验是否为为class包名
* *
* @param str 名称 * @param invokeTarget 名称
* @return true是 false否 * @return true是 false否
*/ */
public static boolean isValidClassName(String invokeTarget) public static boolean isValidClassName(String invokeTarget)

View File

@ -177,6 +177,7 @@ public class SysRole extends BaseEntity
this.deptIds = deptIds; this.deptIds = deptIds;
} }
@Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("roleId", getRoleId()) .append("roleId", getRoleId())

View File

@ -346,6 +346,7 @@ public class SysUser extends BaseEntity
.append("updateTime", getUpdateTime()) .append("updateTime", getUpdateTime())
.append("remark", getRemark()) .append("remark", getRemark())
.append("dept", getDept()) .append("dept", getDept())
.append("roles", getRoles())
.toString(); .toString();
} }
} }

View File

@ -307,7 +307,7 @@ public class SysUserServiceImpl implements ISysUserService
} }
/** /**
* 校验用户名称是否唯一 * 校验手机号是否唯一
* *
* @param user 用户信息 * @param user 用户信息
* @return * @return

View File

@ -47,6 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''"> <if test="status != null and status != ''">
AND status = #{status} AND status = #{status}
</if> </if>
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${params.dataScope} ${params.dataScope}
order by d.parent_id, d.order_num 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"> <select id="checkDeptNameUnique" resultMap="SysDeptResult">
<include refid="selectDeptVo"/> <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>
<select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult"> <select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">

View File

@ -131,13 +131,13 @@
<if test="menuName != null and menuName != ''">menu_name = #{menuName},</if> <if test="menuName != null and menuName != ''">menu_name = #{menuName},</if>
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if> <if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
<if test="orderNum != null and orderNum != ''">order_num = #{orderNum},</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="target != null and target != ''">target = #{target},</if>
<if test="menuType != null and menuType != ''">menu_type = #{menuType},</if> <if test="menuType != null and menuType != ''">menu_type = #{menuType},</if>
<if test="visible != null">visible = #{visible},</if> <if test="visible != null">visible = #{visible},</if>
<if test="perms !=null">perms = #{perms},</if> <if test="perms !=null">perms = #{perms},</if>
<if test="icon !=null and icon != ''">icon = #{icon},</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> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate() update_time = sysdate()
</set> </set>

View File

@ -119,29 +119,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectUserByLoginName" parameterType="String" resultMap="SysUserResult"> <select id="selectUserByLoginName" parameterType="String" resultMap="SysUserResult">
<include refid="selectUserVo"/> <include refid="selectUserVo"/>
where u.login_name = #{userName} where u.login_name = #{userName} and u.del_flag = '0'
</select> </select>
<select id="selectUserByPhoneNumber" parameterType="String" resultMap="SysUserResult"> <select id="selectUserByPhoneNumber" parameterType="String" resultMap="SysUserResult">
<include refid="selectUserVo"/> <include refid="selectUserVo"/>
where u.phonenumber = #{phonenumber} where u.phonenumber = #{phonenumber} and u.del_flag = '0'
</select> </select>
<select id="selectUserByEmail" parameterType="String" resultMap="SysUserResult"> <select id="selectUserByEmail" parameterType="String" resultMap="SysUserResult">
<include refid="selectUserVo"/> <include refid="selectUserVo"/>
where u.email = #{email} where u.email = #{email} and u.del_flag = '0'
</select> </select>
<select id="checkLoginNameUnique" parameterType="String" resultType="int"> <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>
<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult"> <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>
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult"> <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>
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult"> <select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
@ -150,7 +150,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<delete id="deleteUserById" parameterType="Long"> <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>
<delete id="deleteUserByIds" parameterType="Long"> <delete id="deleteUserByIds" parameterType="Long">