浏览代码

上传文件按日期存储及部分文件路径位置

RuoYi 6 年之前
父节点
当前提交
742846b421
共有 34 个文件被更改,包括 120 次插入94 次删除
  1. 7 1
      pom.xml
  2. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
  3. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
  4. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java
  5. 4 7
      ruoyi-admin/src/main/resources/i18n/messages.properties
  6. 1 1
      ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js
  7. 2 2
      ruoyi-common/src/main/java/com/ruoyi/common/exception/base/BaseException.java
  8. 19 0
      ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileException.java
  9. 4 27
      ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileNameLengthLimitExceededException.java
  10. 16 0
      ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileSizeLimitExceededException.java
  11. 1 1
      ruoyi-common/src/main/java/com/ruoyi/common/exception/user/CaptchaException.java
  12. 1 1
      ruoyi-common/src/main/java/com/ruoyi/common/exception/user/RoleBlockedException.java
  13. 1 1
      ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserBlockedException.java
  14. 1 1
      ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserDeleteException.java
  15. 2 2
      ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserException.java
  16. 1 1
      ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserNotExistsException.java
  17. 1 1
      ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordNotMatchException.java
  18. 1 1
      ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordRetryLimitCountException.java
  19. 1 1
      ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordRetryLimitExceedException.java
  20. 2 3
      ruoyi-common/src/main/java/com/ruoyi/common/page/TableSupport.java
  21. 1 1
      ruoyi-common/src/main/java/com/ruoyi/common/utils/MessageUtils.java
  22. 1 2
      ruoyi-common/src/main/java/com/ruoyi/common/utils/ServletUtils.java
  23. 22 15
      ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java
  24. 1 1
      ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java
  25. 2 1
      ruoyi-framework/src/main/java/com/ruoyi/framework/config/ServerConfig.java
  26. 1 1
      ruoyi-framework/src/main/java/com/ruoyi/framework/manager/factory/AsyncFactory.java
  27. 7 6
      ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/realm/UserRealm.java
  28. 7 7
      ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/service/SysLoginService.java
  29. 3 3
      ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/service/SysPasswordService.java
  30. 2 1
      ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/session/OnlineSessionFactory.java
  31. 1 1
      ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/web/filter/LogoutFilter.java
  32. 1 0
      ruoyi-framework/src/main/java/com/ruoyi/framework/util/PermissionUtils.java
  33. 1 1
      ruoyi-framework/src/main/java/com/ruoyi/framework/web/base/BaseController.java
  34. 2 0
      ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java

+ 7 - 1
pom.xml

@@ -53,11 +53,17 @@
 
 	<dependencies>
 
-		<!--Spring框架基本的核心工具-->
+		<!-- Spring框架基本的核心工具 -->
 		<dependency>
 			<groupId>org.springframework</groupId>
 			<artifactId>spring-context-support</artifactId>
 		</dependency>
+		
+		<!-- SpringWeb模块 -->
+		<dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-web</artifactId>
+        </dependency>
 
         <!-- SpringBoot集成mybatis框架 -->
         <dependency>

+ 1 - 1
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;
 
 /**
  * 通用请求处理

+ 1 - 1
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;
 
 /**

+ 1 - 1
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;

+ 4 - 7
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=上传的文件大小超出限制的文件大小!<br/>允许的文件最大大小是:{0}MB!
+upload.filename.exceed.length=上传的文件名最长{0}个字符
+
 ##权限
 no.permission=您没有数据的权限,请联系管理员添加权限 [{0}]
 no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}]

+ 1 - 1
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);
 	};
 

+ 2 - 2
ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/base/BaseException.java → 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;
 
 /**
  * 基础异常

+ 19 - 0
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);
+    }
+
+}

+ 4 - 27
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)
-    {
-        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()
+    public FileNameLengthLimitExceededException(int defaultFileNameLength)
     {
-        return maxLength;
+        super("upload.filename.exceed.length", new Object[] { defaultFileNameLength });
     }
 }

+ 16 - 0
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 });
+    }
+}

+ 1 - 1
ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/CaptchaException.java → 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;
 
 /**
  * 验证码错误异常类

+ 1 - 1
ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/RoleBlockedException.java → 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;
 
 /**
  * 角色锁定异常类

+ 1 - 1
ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/UserBlockedException.java → 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;
 
 /**
  * 用户锁定异常类

+ 1 - 1
ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/UserDeleteException.java → 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;
 
 /**
  * 用户账号已被删除

+ 2 - 2
ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/UserException.java → 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;
 
 /**
  * 用户信息异常类

+ 1 - 1
ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/UserNotExistsException.java → 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;
 
 /**
  * 用户不存在异常类

+ 1 - 1
ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/UserPasswordNotMatchException.java → 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;
 
 /**
  * 用户密码不正确或不符合规范异常类

+ 1 - 1
ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/UserPasswordRetryLimitCountException.java → 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;
 
 /**
  * 用户错误记数异常类

+ 1 - 1
ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/user/UserPasswordRetryLimitExceedException.java → 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;
 
 /**
  * 用户错误最大次数异常类

+ 2 - 3
ruoyi-framework/src/main/java/com/ruoyi/framework/web/page/TableSupport.java → 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;
 
 /**
  * 表格数据处理

+ 1 - 1
ruoyi-framework/src/main/java/com/ruoyi/framework/util/MessageUtils.java → 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;

+ 1 - 2
ruoyi-framework/src/main/java/com/ruoyi/framework/util/ServletUtils.java → 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;
 
 /**
  * 客户端工具类

+ 22 - 15
ruoyi-framework/src/main/java/com/ruoyi/framework/util/FileUploadUtils.java → 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,17 +19,17 @@ public class FileUploadUtils
     /**
      * 默认大小 50M
      */
-    public static final long DEFAULT_MAX_SIZE = 52428800;
+    public static final long DEFAULT_MAX_SIZE = 50 * 1024 * 1024;
 
     /**
-     * 默认上传的地址
+     * 默认的文件名最大长度 100
      */
-    private static String defaultBaseDir = Global.getProfile();
+    public static final int DEFAULT_FILE_NAME_LENGTH = 100;
 
     /**
-     * 默认的文件名最大长度
+     * 默认上传的地址
      */
-    public static final int DEFAULT_FILE_NAME_LENGTH = 200;
+    private static String defaultBaseDir = Global.getProfile();
 
     /**
      * 默认文件类型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);
         }
     }
 }

+ 1 - 1
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;

+ 2 - 1
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;
 
 /**
  * 服务相关配置

+ 1 - 1
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;

+ 7 - 6
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;

+ 7 - 7
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;
 

+ 3 - 3
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;
 
 /**

+ 2 - 1
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;
 
 /**

+ 1 - 1
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;
 

+ 1 - 0
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 工具类

+ 1 - 1
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;
 
 /**

+ 2 - 0
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");