diff --git a/pom.xml b/pom.xml index 912092021..4d93d707c 100644 --- a/pom.xml +++ b/pom.xml @@ -53,11 +53,17 @@ - + org.springframework spring-context-support + + + + org.springframework + spring-web + diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java index d57abddf9..fccdbc09e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java @@ -14,9 +14,9 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.MultipartFile; import com.ruoyi.common.base.AjaxResult; import com.ruoyi.common.config.Global; +import com.ruoyi.common.utils.file.FileUploadUtils; import com.ruoyi.common.utils.file.FileUtils; import com.ruoyi.framework.config.ServerConfig; -import com.ruoyi.framework.util.FileUploadUtils; /** * 通用请求处理 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java index 97d9d2794..16863e9d7 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java @@ -11,8 +11,8 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.ruoyi.common.base.AjaxResult; +import com.ruoyi.common.utils.ServletUtils; import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.framework.util.ServletUtils; import com.ruoyi.framework.web.base.BaseController; /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java index 92eacc3bb..d441165ec 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java @@ -16,8 +16,8 @@ import com.ruoyi.common.base.AjaxResult; import com.ruoyi.common.config.Global; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.file.FileUploadUtils; import com.ruoyi.framework.shiro.service.SysPasswordService; -import com.ruoyi.framework.util.FileUploadUtils; import com.ruoyi.framework.util.ShiroUtils; import com.ruoyi.system.domain.SysUser; import com.ruoyi.system.service.ISysDictDataService; diff --git a/ruoyi-admin/src/main/resources/i18n/messages.properties b/ruoyi-admin/src/main/resources/i18n/messages.properties index b62fc1c89..ef2a3e4b4 100644 --- a/ruoyi-admin/src/main/resources/i18n/messages.properties +++ b/ruoyi-admin/src/main/resources/i18n/messages.properties @@ -22,13 +22,10 @@ user.notfound=请重新登录 user.forcelogout=管理员强制退出,请重新登录 user.unknown.error=未知错误,请重新登录 -#批量插入用户错误信息 -user.import.excel.null=Excel数据为空,请按照导入模板填写数据 -user.import.excel.data.null=Excel数据为空,只有标题行,请按照导入模板填写数据 -user.import.excel.filetype.error=文件不是Excel文件 -user.import.excel.file.error=文件名为空,文件为空 -user.import.excel.fileinput.error=获取Excel2003流错误 -user.import.excel.fileinputx.error=获取Excel2007流错误 +##文件上传消息 +upload.exceed.maxSize=上传的文件大小超出限制的文件大小!
允许的文件最大大小是:{0}MB! +upload.filename.exceed.length=上传的文件名最长{0}个字符 + ##权限 no.permission=您没有数据的权限,请联系管理员添加权限 [{0}] no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}] diff --git a/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js b/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js index 2376f9444..ee98b198b 100644 --- a/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js +++ b/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js @@ -15,7 +15,7 @@ // 判断是否 iphone var isIPhone = function () { - let browserName = navigator.userAgent.toLowerCase(); + var browserName = navigator.userAgent.toLowerCase(); return /(iPhone|iPad|iPod|iOS)/i.test(browserName); }; diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/base/BaseException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/base/BaseException.java similarity index 90% rename from ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/base/BaseException.java rename to ruoyi-common/src/main/java/com/ruoyi/common/exception/base/BaseException.java index a1e33f6f0..3dd2c1ee7 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/base/BaseException.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/base/BaseException.java @@ -1,7 +1,7 @@ -package com.ruoyi.framework.web.exception.base; +package com.ruoyi.common.exception.base; +import com.ruoyi.common.utils.MessageUtils; import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.framework.util.MessageUtils; /** * 基础异常 diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileException.java new file mode 100644 index 000000000..871f09b52 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileException.java @@ -0,0 +1,19 @@ +package com.ruoyi.common.exception.file; + +import com.ruoyi.common.exception.base.BaseException; + +/** + * 文件信息异常类 + * + * @author ruoyi + */ +public class FileException extends BaseException +{ + private static final long serialVersionUID = 1L; + + public FileException(String code, Object[] args) + { + super("file", code, args, null); + } + +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileNameLengthLimitExceededException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileNameLengthLimitExceededException.java index b59fcbe4e..44941b8bc 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileNameLengthLimitExceededException.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileNameLengthLimitExceededException.java @@ -1,39 +1,16 @@ package com.ruoyi.common.exception.file; -import org.apache.commons.fileupload.FileUploadException; - /** - * 文件名超长 误异常类 + * 文件名称超长限制异常类 * * @author ruoyi */ -public class FileNameLengthLimitExceededException extends FileUploadException +public class FileNameLengthLimitExceededException extends FileException { private static final long serialVersionUID = 1L; - private int length; - private int maxLength; - private String filename; - public FileNameLengthLimitExceededException(String filename, int length, int maxLength) + public FileNameLengthLimitExceededException(int defaultFileNameLength) { - super("file name : [" + filename + "], length : [" + length + "], max length : [" + maxLength + "]"); - this.length = length; - this.maxLength = maxLength; - this.filename = filename; - } - - public String getFilename() - { - return filename; - } - - public int getLength() - { - return length; - } - - public int getMaxLength() - { - return maxLength; + super("upload.filename.exceed.length", new Object[] { defaultFileNameLength }); } } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileSizeLimitExceededException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileSizeLimitExceededException.java new file mode 100644 index 000000000..ec6ab054d --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileSizeLimitExceededException.java @@ -0,0 +1,16 @@ +package com.ruoyi.common.exception.file; + +/** + * 文件名大小限制异常类 + * + * @author ruoyi + */ +public class FileSizeLimitExceededException extends FileException +{ + private static final long serialVersionUID = 1L; + + public FileSizeLimitExceededException(long defaultMaxSize) + { + super("upload.exceed.maxSize", new Object[] { defaultMaxSize }); + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/CaptchaException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/CaptchaException.java similarity index 79% rename from ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/CaptchaException.java rename to ruoyi-common/src/main/java/com/ruoyi/common/exception/user/CaptchaException.java index dcd4e5234..e3334ae37 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/CaptchaException.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/CaptchaException.java @@ -1,4 +1,4 @@ -package com.ruoyi.framework.web.exception.user; +package com.ruoyi.common.exception.user; /** * 验证码错误异常类 diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/RoleBlockedException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/RoleBlockedException.java similarity index 79% rename from ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/RoleBlockedException.java rename to ruoyi-common/src/main/java/com/ruoyi/common/exception/user/RoleBlockedException.java index ea6d2517a..e11624426 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/RoleBlockedException.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/RoleBlockedException.java @@ -1,4 +1,4 @@ -package com.ruoyi.framework.web.exception.user; +package com.ruoyi.common.exception.user; /** * 角色锁定异常类 diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/UserBlockedException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserBlockedException.java similarity index 79% rename from ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/UserBlockedException.java rename to ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserBlockedException.java index 10e2d85bf..8feb8493e 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/UserBlockedException.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserBlockedException.java @@ -1,4 +1,4 @@ -package com.ruoyi.framework.web.exception.user; +package com.ruoyi.common.exception.user; /** * 用户锁定异常类 diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/UserDeleteException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserDeleteException.java similarity index 80% rename from ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/UserDeleteException.java rename to ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserDeleteException.java index c1839375b..cf0724228 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/UserDeleteException.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserDeleteException.java @@ -1,4 +1,4 @@ -package com.ruoyi.framework.web.exception.user; +package com.ruoyi.common.exception.user; /** * 用户账号已被删除 diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/UserException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserException.java similarity index 67% rename from ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/UserException.java rename to ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserException.java index a1f4fada9..79160d861 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/UserException.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserException.java @@ -1,6 +1,6 @@ -package com.ruoyi.framework.web.exception.user; +package com.ruoyi.common.exception.user; -import com.ruoyi.framework.web.exception.base.BaseException; +import com.ruoyi.common.exception.base.BaseException; /** * 用户信息异常类 diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/UserNotExistsException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserNotExistsException.java similarity index 80% rename from ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/UserNotExistsException.java rename to ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserNotExistsException.java index 8e9e75110..ed4bea3ac 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/UserNotExistsException.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserNotExistsException.java @@ -1,4 +1,4 @@ -package com.ruoyi.framework.web.exception.user; +package com.ruoyi.common.exception.user; /** * 用户不存在异常类 diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/UserPasswordNotMatchException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordNotMatchException.java similarity index 82% rename from ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/UserPasswordNotMatchException.java rename to ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordNotMatchException.java index 11f1df73a..71449e293 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/UserPasswordNotMatchException.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordNotMatchException.java @@ -1,4 +1,4 @@ -package com.ruoyi.framework.web.exception.user; +package com.ruoyi.common.exception.user; /** * 用户密码不正确或不符合规范异常类 diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/UserPasswordRetryLimitCountException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordRetryLimitCountException.java similarity index 84% rename from ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/UserPasswordRetryLimitCountException.java rename to ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordRetryLimitCountException.java index 65c95cf1a..4222135f5 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/UserPasswordRetryLimitCountException.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordRetryLimitCountException.java @@ -1,4 +1,4 @@ -package com.ruoyi.framework.web.exception.user; +package com.ruoyi.common.exception.user; /** * 用户错误记数异常类 diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/UserPasswordRetryLimitExceedException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordRetryLimitExceedException.java similarity index 85% rename from ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/UserPasswordRetryLimitExceedException.java rename to ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordRetryLimitExceedException.java index ad0ecf326..b48c40657 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/UserPasswordRetryLimitExceedException.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordRetryLimitExceedException.java @@ -1,4 +1,4 @@ -package com.ruoyi.framework.web.exception.user; +package com.ruoyi.common.exception.user; /** * 用户错误最大次数异常类 diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/page/TableSupport.java b/ruoyi-common/src/main/java/com/ruoyi/common/page/TableSupport.java similarity index 82% rename from ruoyi-framework/src/main/java/com/ruoyi/framework/web/page/TableSupport.java rename to ruoyi-common/src/main/java/com/ruoyi/common/page/TableSupport.java index 658c32404..6b9342908 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/page/TableSupport.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/page/TableSupport.java @@ -1,8 +1,7 @@ -package com.ruoyi.framework.web.page; +package com.ruoyi.common.page; import com.ruoyi.common.constant.Constants; -import com.ruoyi.common.page.PageDomain; -import com.ruoyi.framework.util.ServletUtils; +import com.ruoyi.common.utils.ServletUtils; /** * 表格数据处理 diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/util/MessageUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/MessageUtils.java similarity index 90% rename from ruoyi-framework/src/main/java/com/ruoyi/framework/util/MessageUtils.java rename to ruoyi-common/src/main/java/com/ruoyi/common/utils/MessageUtils.java index f656392cb..879421ba0 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/util/MessageUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/MessageUtils.java @@ -1,4 +1,4 @@ -package com.ruoyi.framework.util; +package com.ruoyi.common.utils; import org.springframework.context.MessageSource; import com.ruoyi.common.utils.spring.SpringUtils; diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/util/ServletUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/ServletUtils.java similarity index 93% rename from ruoyi-framework/src/main/java/com/ruoyi/framework/util/ServletUtils.java rename to ruoyi-common/src/main/java/com/ruoyi/common/utils/ServletUtils.java index 4f56a6fd9..f4b96af4b 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/util/ServletUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/ServletUtils.java @@ -1,4 +1,4 @@ -package com.ruoyi.framework.util; +package com.ruoyi.common.utils; import java.io.IOException; import javax.servlet.http.HttpServletRequest; @@ -8,7 +8,6 @@ import org.springframework.web.context.request.RequestAttributes; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; import com.ruoyi.common.support.Convert; -import com.ruoyi.common.utils.StringUtils; /** * 客户端工具类 diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/util/FileUploadUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java similarity index 76% rename from ruoyi-framework/src/main/java/com/ruoyi/framework/util/FileUploadUtils.java rename to ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java index b8e9ccf20..a1e2e2a81 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/util/FileUploadUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java @@ -1,11 +1,12 @@ -package com.ruoyi.framework.util; +package com.ruoyi.common.utils.file; import java.io.File; import java.io.IOException; -import org.apache.tomcat.util.http.fileupload.FileUploadBase.FileSizeLimitExceededException; import org.springframework.web.multipart.MultipartFile; import com.ruoyi.common.config.Global; import com.ruoyi.common.exception.file.FileNameLengthLimitExceededException; +import com.ruoyi.common.exception.file.FileSizeLimitExceededException; +import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.Md5Utils; /** @@ -18,18 +19,18 @@ public class FileUploadUtils /** * 默认大小 50M */ - public static final long DEFAULT_MAX_SIZE = 52428800; + public static final long DEFAULT_MAX_SIZE = 50 * 1024 * 1024; + + /** + * 默认的文件名最大长度 100 + */ + public static final int DEFAULT_FILE_NAME_LENGTH = 100; /** * 默认上传的地址 */ private static String defaultBaseDir = Global.getProfile(); - /** - * 默认的文件名最大长度 - */ - public static final int DEFAULT_FILE_NAME_LENGTH = 200; - /** * 默认文件类型jpg */ @@ -62,7 +63,7 @@ public class FileUploadUtils } catch (Exception e) { - throw new IOException(e); + throw new IOException(e.getMessage(), e); } } @@ -82,7 +83,7 @@ public class FileUploadUtils } catch (Exception e) { - throw new IOException(e); + throw new IOException(e.getMessage(), e); } } @@ -104,19 +105,25 @@ public class FileUploadUtils int fileNamelength = file.getOriginalFilename().length(); if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH) { - throw new FileNameLengthLimitExceededException(file.getOriginalFilename(), fileNamelength, - FileUploadUtils.DEFAULT_FILE_NAME_LENGTH); + throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH); } assertAllowed(file); - String fileName = encodingFilename(file.getOriginalFilename(), extension); + String fileName = extractFilename(file, extension); File desc = getAbsoluteFile(baseDir, baseDir + fileName); file.transferTo(desc); return fileName; } + public static final String extractFilename(MultipartFile file, String extension) + { + String filename = file.getOriginalFilename(); + filename = DateUtils.datePath() + "/" + encodingFilename(filename) + extension; + return filename; + } + private static final File getAbsoluteFile(String uploadDir, String filename) throws IOException { File desc = new File(File.separator + filename); @@ -135,10 +142,10 @@ public class FileUploadUtils /** * 编码文件名 */ - private static final String encodingFilename(String filename, String extension) + private static final String encodingFilename(String filename) { filename = filename.replace("_", " "); - filename = Md5Utils.hash(filename + System.nanoTime() + counter++) + extension; + filename = Md5Utils.hash(filename + System.nanoTime() + counter++); return filename; } @@ -154,7 +161,7 @@ public class FileUploadUtils long size = file.getSize(); if (DEFAULT_MAX_SIZE != -1 && size > DEFAULT_MAX_SIZE) { - throw new FileSizeLimitExceededException("not allowed upload upload", size, DEFAULT_MAX_SIZE); + throw new FileSizeLimitExceededException(DEFAULT_MAX_SIZE / 1024 / 1024); } } } diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java index e8d297c33..19619ab1d 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java @@ -15,10 +15,10 @@ import org.springframework.stereotype.Component; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.enums.BusinessStatus; import com.ruoyi.common.json.JSON; +import com.ruoyi.common.utils.ServletUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.framework.manager.AsyncManager; import com.ruoyi.framework.manager.factory.AsyncFactory; -import com.ruoyi.framework.util.ServletUtils; import com.ruoyi.framework.util.ShiroUtils; import com.ruoyi.system.domain.SysOperLog; import com.ruoyi.system.domain.SysUser; diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ServerConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ServerConfig.java index cc4045b10..a7fb0998f 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ServerConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ServerConfig.java @@ -2,7 +2,8 @@ package com.ruoyi.framework.config; import javax.servlet.http.HttpServletRequest; import org.springframework.stereotype.Component; -import com.ruoyi.framework.util.ServletUtils; + +import com.ruoyi.common.utils.ServletUtils; /** * 服务相关配置 diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/factory/AsyncFactory.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/factory/AsyncFactory.java index a85d775e9..94019095d 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/factory/AsyncFactory.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/factory/AsyncFactory.java @@ -5,10 +5,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.ruoyi.common.constant.Constants; import com.ruoyi.common.utils.AddressUtils; +import com.ruoyi.common.utils.ServletUtils; import com.ruoyi.common.utils.spring.SpringUtils; import com.ruoyi.framework.shiro.session.OnlineSession; import com.ruoyi.framework.util.LogUtils; -import com.ruoyi.framework.util.ServletUtils; import com.ruoyi.framework.util.ShiroUtils; import com.ruoyi.system.domain.SysLogininfor; import com.ruoyi.system.domain.SysOperLog; diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/realm/UserRealm.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/realm/UserRealm.java index e0298f388..258efba3f 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/realm/UserRealm.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/realm/UserRealm.java @@ -19,14 +19,15 @@ import org.apache.shiro.subject.PrincipalCollection; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; + +import com.ruoyi.common.exception.user.CaptchaException; +import com.ruoyi.common.exception.user.RoleBlockedException; +import com.ruoyi.common.exception.user.UserBlockedException; +import com.ruoyi.common.exception.user.UserNotExistsException; +import com.ruoyi.common.exception.user.UserPasswordNotMatchException; +import com.ruoyi.common.exception.user.UserPasswordRetryLimitExceedException; import com.ruoyi.framework.shiro.service.SysLoginService; import com.ruoyi.framework.util.ShiroUtils; -import com.ruoyi.framework.web.exception.user.CaptchaException; -import com.ruoyi.framework.web.exception.user.RoleBlockedException; -import com.ruoyi.framework.web.exception.user.UserBlockedException; -import com.ruoyi.framework.web.exception.user.UserNotExistsException; -import com.ruoyi.framework.web.exception.user.UserPasswordNotMatchException; -import com.ruoyi.framework.web.exception.user.UserPasswordRetryLimitExceedException; import com.ruoyi.system.domain.SysUser; import com.ruoyi.system.service.ISysMenuService; import com.ruoyi.system.service.ISysRoleService; diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/service/SysLoginService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/service/SysLoginService.java index 050153058..92ebe89d8 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/service/SysLoginService.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/service/SysLoginService.java @@ -7,17 +7,17 @@ import com.ruoyi.common.constant.Constants; import com.ruoyi.common.constant.ShiroConstants; import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.enums.UserStatus; +import com.ruoyi.common.exception.user.CaptchaException; +import com.ruoyi.common.exception.user.UserBlockedException; +import com.ruoyi.common.exception.user.UserDeleteException; +import com.ruoyi.common.exception.user.UserNotExistsException; +import com.ruoyi.common.exception.user.UserPasswordNotMatchException; import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.MessageUtils; +import com.ruoyi.common.utils.ServletUtils; import com.ruoyi.framework.manager.AsyncManager; import com.ruoyi.framework.manager.factory.AsyncFactory; -import com.ruoyi.framework.util.MessageUtils; -import com.ruoyi.framework.util.ServletUtils; import com.ruoyi.framework.util.ShiroUtils; -import com.ruoyi.framework.web.exception.user.CaptchaException; -import com.ruoyi.framework.web.exception.user.UserBlockedException; -import com.ruoyi.framework.web.exception.user.UserDeleteException; -import com.ruoyi.framework.web.exception.user.UserNotExistsException; -import com.ruoyi.framework.web.exception.user.UserPasswordNotMatchException; import com.ruoyi.system.domain.SysUser; import com.ruoyi.system.service.ISysUserService; diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/service/SysPasswordService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/service/SysPasswordService.java index f3bd37f86..d8a763262 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/service/SysPasswordService.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/service/SysPasswordService.java @@ -9,11 +9,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.exception.user.UserPasswordNotMatchException; +import com.ruoyi.common.exception.user.UserPasswordRetryLimitExceedException; +import com.ruoyi.common.utils.MessageUtils; import com.ruoyi.framework.manager.AsyncManager; import com.ruoyi.framework.manager.factory.AsyncFactory; -import com.ruoyi.framework.util.MessageUtils; -import com.ruoyi.framework.web.exception.user.UserPasswordNotMatchException; -import com.ruoyi.framework.web.exception.user.UserPasswordRetryLimitExceedException; import com.ruoyi.system.domain.SysUser; /** diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/session/OnlineSessionFactory.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/session/OnlineSessionFactory.java index aed924706..e6f6896d9 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/session/OnlineSessionFactory.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/session/OnlineSessionFactory.java @@ -7,7 +7,8 @@ import org.apache.shiro.session.mgt.SessionFactory; import org.apache.shiro.web.session.mgt.WebSessionContext; import org.springframework.stereotype.Component; import com.ruoyi.common.utils.IpUtils; -import com.ruoyi.framework.util.ServletUtils; +import com.ruoyi.common.utils.ServletUtils; + import eu.bitwalker.useragentutils.UserAgent; /** diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/web/filter/LogoutFilter.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/web/filter/LogoutFilter.java index bf70f17cd..5970838fc 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/web/filter/LogoutFilter.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/web/filter/LogoutFilter.java @@ -7,10 +7,10 @@ import org.apache.shiro.subject.Subject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.utils.MessageUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.framework.manager.AsyncManager; import com.ruoyi.framework.manager.factory.AsyncFactory; -import com.ruoyi.framework.util.MessageUtils; import com.ruoyi.framework.util.ShiroUtils; import com.ruoyi.system.domain.SysUser; diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/util/PermissionUtils.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/util/PermissionUtils.java index f0e642636..835e8fc62 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/util/PermissionUtils.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/util/PermissionUtils.java @@ -2,6 +2,7 @@ package com.ruoyi.framework.util; import org.apache.commons.lang3.StringUtils; import com.ruoyi.common.constant.PermissionConstants; +import com.ruoyi.common.utils.MessageUtils; /** * permission 工具类 diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/base/BaseController.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/base/BaseController.java index 2d971e50c..4a83cdec3 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/base/BaseController.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/base/BaseController.java @@ -10,10 +10,10 @@ import com.github.pagehelper.PageInfo; import com.ruoyi.common.base.AjaxResult; import com.ruoyi.common.page.PageDomain; import com.ruoyi.common.page.TableDataInfo; +import com.ruoyi.common.page.TableSupport; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.framework.util.ShiroUtils; -import com.ruoyi.framework.web.page.TableSupport; import com.ruoyi.system.domain.SysUser; /** diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java index bccc4650e..ce2442589 100644 --- a/ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java @@ -219,6 +219,7 @@ public class GenUtils javaTypeMap.put("smallint", "Integer"); javaTypeMap.put("mediumint", "Integer"); javaTypeMap.put("int", "Integer"); + javaTypeMap.put("number", "Integer"); javaTypeMap.put("integer", "integer"); javaTypeMap.put("bigint", "Long"); javaTypeMap.put("float", "Float"); @@ -227,6 +228,7 @@ public class GenUtils javaTypeMap.put("bit", "Boolean"); javaTypeMap.put("char", "String"); javaTypeMap.put("varchar", "String"); + javaTypeMap.put("varchar2", "String"); javaTypeMap.put("tinytext", "String"); javaTypeMap.put("text", "String"); javaTypeMap.put("mediumtext", "String");