mirror of https://gitee.com/y_project/RuoYi.git
上传文件按日期存储及部分文件路径位置
parent
4829163bab
commit
742846b421
8
pom.xml
8
pom.xml
|
@ -53,11 +53,17 @@
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<!--Spring框架基本的核心工具-->
|
<!-- Spring框架基本的核心工具 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
<artifactId>spring-context-support</artifactId>
|
<artifactId>spring-context-support</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringWeb模块 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- SpringBoot集成mybatis框架 -->
|
<!-- SpringBoot集成mybatis框架 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -14,9 +14,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import com.ruoyi.common.base.AjaxResult;
|
import com.ruoyi.common.base.AjaxResult;
|
||||||
import com.ruoyi.common.config.Global;
|
import com.ruoyi.common.config.Global;
|
||||||
|
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||||
import com.ruoyi.common.utils.file.FileUtils;
|
import com.ruoyi.common.utils.file.FileUtils;
|
||||||
import com.ruoyi.framework.config.ServerConfig;
|
import com.ruoyi.framework.config.ServerConfig;
|
||||||
import com.ruoyi.framework.util.FileUploadUtils;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通用请求处理
|
* 通用请求处理
|
||||||
|
|
|
@ -11,8 +11,8 @@ import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import com.ruoyi.common.base.AjaxResult;
|
import com.ruoyi.common.base.AjaxResult;
|
||||||
|
import com.ruoyi.common.utils.ServletUtils;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.framework.util.ServletUtils;
|
|
||||||
import com.ruoyi.framework.web.base.BaseController;
|
import com.ruoyi.framework.web.base.BaseController;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -16,8 +16,8 @@ import com.ruoyi.common.base.AjaxResult;
|
||||||
import com.ruoyi.common.config.Global;
|
import com.ruoyi.common.config.Global;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||||
import com.ruoyi.framework.shiro.service.SysPasswordService;
|
import com.ruoyi.framework.shiro.service.SysPasswordService;
|
||||||
import com.ruoyi.framework.util.FileUploadUtils;
|
|
||||||
import com.ruoyi.framework.util.ShiroUtils;
|
import com.ruoyi.framework.util.ShiroUtils;
|
||||||
import com.ruoyi.system.domain.SysUser;
|
import com.ruoyi.system.domain.SysUser;
|
||||||
import com.ruoyi.system.service.ISysDictDataService;
|
import com.ruoyi.system.service.ISysDictDataService;
|
||||||
|
|
|
@ -22,13 +22,10 @@ user.notfound=请重新登录
|
||||||
user.forcelogout=管理员强制退出,请重新登录
|
user.forcelogout=管理员强制退出,请重新登录
|
||||||
user.unknown.error=未知错误,请重新登录
|
user.unknown.error=未知错误,请重新登录
|
||||||
|
|
||||||
#批量插入用户错误信息
|
##文件上传消息
|
||||||
user.import.excel.null=Excel数据为空,请按照导入模板填写数据
|
upload.exceed.maxSize=上传的文件大小超出限制的文件大小!<br/>允许的文件最大大小是:{0}MB!
|
||||||
user.import.excel.data.null=Excel数据为空,只有标题行,请按照导入模板填写数据
|
upload.filename.exceed.length=上传的文件名最长{0}个字符
|
||||||
user.import.excel.filetype.error=文件不是Excel文件
|
|
||||||
user.import.excel.file.error=文件名为空,文件为空
|
|
||||||
user.import.excel.fileinput.error=获取Excel2003流错误
|
|
||||||
user.import.excel.fileinputx.error=获取Excel2007流错误
|
|
||||||
##权限
|
##权限
|
||||||
no.permission=您没有数据的权限,请联系管理员添加权限 [{0}]
|
no.permission=您没有数据的权限,请联系管理员添加权限 [{0}]
|
||||||
no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}]
|
no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}]
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
// 判断是否 iphone
|
// 判断是否 iphone
|
||||||
var isIPhone = function () {
|
var isIPhone = function () {
|
||||||
let browserName = navigator.userAgent.toLowerCase();
|
var browserName = navigator.userAgent.toLowerCase();
|
||||||
return /(iPhone|iPad|iPod|iOS)/i.test(browserName);
|
return /(iPhone|iPad|iPod|iOS)/i.test(browserName);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -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.common.utils.StringUtils;
|
||||||
import com.ruoyi.framework.util.MessageUtils;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 基础异常
|
* 基础异常
|
|
@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,39 +1,16 @@
|
||||||
package com.ruoyi.common.exception.file;
|
package com.ruoyi.common.exception.file;
|
||||||
|
|
||||||
import org.apache.commons.fileupload.FileUploadException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件名超长 误异常类
|
* 文件名称超长限制异常类
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class FileNameLengthLimitExceededException extends FileUploadException
|
public class FileNameLengthLimitExceededException extends FileException
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
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 + "]");
|
super("upload.filename.exceed.length", new Object[] { defaultFileNameLength });
|
||||||
this.length = length;
|
|
||||||
this.maxLength = maxLength;
|
|
||||||
this.filename = filename;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getFilename()
|
|
||||||
{
|
|
||||||
return filename;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getLength()
|
|
||||||
{
|
|
||||||
return length;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getMaxLength()
|
|
||||||
{
|
|
||||||
return maxLength;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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,4 +1,4 @@
|
||||||
package com.ruoyi.framework.web.exception.user;
|
package com.ruoyi.common.exception.user;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证码错误异常类
|
* 验证码错误异常类
|
|
@ -1,4 +1,4 @@
|
||||||
package com.ruoyi.framework.web.exception.user;
|
package com.ruoyi.common.exception.user;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色锁定异常类
|
* 角色锁定异常类
|
|
@ -1,4 +1,4 @@
|
||||||
package com.ruoyi.framework.web.exception.user;
|
package com.ruoyi.common.exception.user;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户锁定异常类
|
* 用户锁定异常类
|
|
@ -1,4 +1,4 @@
|
||||||
package com.ruoyi.framework.web.exception.user;
|
package com.ruoyi.common.exception.user;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户账号已被删除
|
* 用户账号已被删除
|
|
@ -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,4 +1,4 @@
|
||||||
package com.ruoyi.framework.web.exception.user;
|
package com.ruoyi.common.exception.user;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户不存在异常类
|
* 用户不存在异常类
|
|
@ -1,4 +1,4 @@
|
||||||
package com.ruoyi.framework.web.exception.user;
|
package com.ruoyi.common.exception.user;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户密码不正确或不符合规范异常类
|
* 用户密码不正确或不符合规范异常类
|
|
@ -1,4 +1,4 @@
|
||||||
package com.ruoyi.framework.web.exception.user;
|
package com.ruoyi.common.exception.user;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户错误记数异常类
|
* 用户错误记数异常类
|
|
@ -1,4 +1,4 @@
|
||||||
package com.ruoyi.framework.web.exception.user;
|
package com.ruoyi.common.exception.user;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户错误最大次数异常类
|
* 用户错误最大次数异常类
|
|
@ -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.constant.Constants;
|
||||||
import com.ruoyi.common.page.PageDomain;
|
import com.ruoyi.common.utils.ServletUtils;
|
||||||
import com.ruoyi.framework.util.ServletUtils;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 表格数据处理
|
* 表格数据处理
|
|
@ -1,4 +1,4 @@
|
||||||
package com.ruoyi.framework.util;
|
package com.ruoyi.common.utils;
|
||||||
|
|
||||||
import org.springframework.context.MessageSource;
|
import org.springframework.context.MessageSource;
|
||||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
import com.ruoyi.common.utils.spring.SpringUtils;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.ruoyi.framework.util;
|
package com.ruoyi.common.utils;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
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.RequestContextHolder;
|
||||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||||
import com.ruoyi.common.support.Convert;
|
import com.ruoyi.common.support.Convert;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 客户端工具类
|
* 客户端工具类
|
|
@ -1,11 +1,12 @@
|
||||||
package com.ruoyi.framework.util;
|
package com.ruoyi.common.utils.file;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import org.apache.tomcat.util.http.fileupload.FileUploadBase.FileSizeLimitExceededException;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import com.ruoyi.common.config.Global;
|
import com.ruoyi.common.config.Global;
|
||||||
import com.ruoyi.common.exception.file.FileNameLengthLimitExceededException;
|
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;
|
import com.ruoyi.common.utils.Md5Utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -18,18 +19,18 @@ public class FileUploadUtils
|
||||||
/**
|
/**
|
||||||
* 默认大小 50M
|
* 默认大小 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();
|
private static String defaultBaseDir = Global.getProfile();
|
||||||
|
|
||||||
/**
|
|
||||||
* 默认的文件名最大长度
|
|
||||||
*/
|
|
||||||
public static final int DEFAULT_FILE_NAME_LENGTH = 200;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 默认文件类型jpg
|
* 默认文件类型jpg
|
||||||
*/
|
*/
|
||||||
|
@ -62,7 +63,7 @@ public class FileUploadUtils
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
throw new IOException(e);
|
throw new IOException(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,7 +83,7 @@ public class FileUploadUtils
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
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();
|
int fileNamelength = file.getOriginalFilename().length();
|
||||||
if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH)
|
if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH)
|
||||||
{
|
{
|
||||||
throw new FileNameLengthLimitExceededException(file.getOriginalFilename(), fileNamelength,
|
throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH);
|
||||||
FileUploadUtils.DEFAULT_FILE_NAME_LENGTH);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
assertAllowed(file);
|
assertAllowed(file);
|
||||||
|
|
||||||
String fileName = encodingFilename(file.getOriginalFilename(), extension);
|
String fileName = extractFilename(file, extension);
|
||||||
|
|
||||||
File desc = getAbsoluteFile(baseDir, baseDir + fileName);
|
File desc = getAbsoluteFile(baseDir, baseDir + fileName);
|
||||||
file.transferTo(desc);
|
file.transferTo(desc);
|
||||||
return fileName;
|
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
|
private static final File getAbsoluteFile(String uploadDir, String filename) throws IOException
|
||||||
{
|
{
|
||||||
File desc = new File(File.separator + filename);
|
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 = filename.replace("_", " ");
|
||||||
filename = Md5Utils.hash(filename + System.nanoTime() + counter++) + extension;
|
filename = Md5Utils.hash(filename + System.nanoTime() + counter++);
|
||||||
return filename;
|
return filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,7 +161,7 @@ public class FileUploadUtils
|
||||||
long size = file.getSize();
|
long size = file.getSize();
|
||||||
if (DEFAULT_MAX_SIZE != -1 && size > DEFAULT_MAX_SIZE)
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -15,10 +15,10 @@ import org.springframework.stereotype.Component;
|
||||||
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import com.ruoyi.common.enums.BusinessStatus;
|
import com.ruoyi.common.enums.BusinessStatus;
|
||||||
import com.ruoyi.common.json.JSON;
|
import com.ruoyi.common.json.JSON;
|
||||||
|
import com.ruoyi.common.utils.ServletUtils;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.framework.manager.AsyncManager;
|
import com.ruoyi.framework.manager.AsyncManager;
|
||||||
import com.ruoyi.framework.manager.factory.AsyncFactory;
|
import com.ruoyi.framework.manager.factory.AsyncFactory;
|
||||||
import com.ruoyi.framework.util.ServletUtils;
|
|
||||||
import com.ruoyi.framework.util.ShiroUtils;
|
import com.ruoyi.framework.util.ShiroUtils;
|
||||||
import com.ruoyi.system.domain.SysOperLog;
|
import com.ruoyi.system.domain.SysOperLog;
|
||||||
import com.ruoyi.system.domain.SysUser;
|
import com.ruoyi.system.domain.SysUser;
|
||||||
|
|
|
@ -2,7 +2,8 @@ package com.ruoyi.framework.config;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import com.ruoyi.framework.util.ServletUtils;
|
|
||||||
|
import com.ruoyi.common.utils.ServletUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 服务相关配置
|
* 服务相关配置
|
||||||
|
|
|
@ -5,10 +5,10 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import com.ruoyi.common.constant.Constants;
|
import com.ruoyi.common.constant.Constants;
|
||||||
import com.ruoyi.common.utils.AddressUtils;
|
import com.ruoyi.common.utils.AddressUtils;
|
||||||
|
import com.ruoyi.common.utils.ServletUtils;
|
||||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||||
import com.ruoyi.framework.shiro.session.OnlineSession;
|
import com.ruoyi.framework.shiro.session.OnlineSession;
|
||||||
import com.ruoyi.framework.util.LogUtils;
|
import com.ruoyi.framework.util.LogUtils;
|
||||||
import com.ruoyi.framework.util.ServletUtils;
|
|
||||||
import com.ruoyi.framework.util.ShiroUtils;
|
import com.ruoyi.framework.util.ShiroUtils;
|
||||||
import com.ruoyi.system.domain.SysLogininfor;
|
import com.ruoyi.system.domain.SysLogininfor;
|
||||||
import com.ruoyi.system.domain.SysOperLog;
|
import com.ruoyi.system.domain.SysOperLog;
|
||||||
|
|
|
@ -19,14 +19,15 @@ import org.apache.shiro.subject.PrincipalCollection;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
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.shiro.service.SysLoginService;
|
||||||
import com.ruoyi.framework.util.ShiroUtils;
|
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.domain.SysUser;
|
||||||
import com.ruoyi.system.service.ISysMenuService;
|
import com.ruoyi.system.service.ISysMenuService;
|
||||||
import com.ruoyi.system.service.ISysRoleService;
|
import com.ruoyi.system.service.ISysRoleService;
|
||||||
|
|
|
@ -7,17 +7,17 @@ import com.ruoyi.common.constant.Constants;
|
||||||
import com.ruoyi.common.constant.ShiroConstants;
|
import com.ruoyi.common.constant.ShiroConstants;
|
||||||
import com.ruoyi.common.constant.UserConstants;
|
import com.ruoyi.common.constant.UserConstants;
|
||||||
import com.ruoyi.common.enums.UserStatus;
|
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.DateUtils;
|
||||||
|
import com.ruoyi.common.utils.MessageUtils;
|
||||||
|
import com.ruoyi.common.utils.ServletUtils;
|
||||||
import com.ruoyi.framework.manager.AsyncManager;
|
import com.ruoyi.framework.manager.AsyncManager;
|
||||||
import com.ruoyi.framework.manager.factory.AsyncFactory;
|
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.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.domain.SysUser;
|
||||||
import com.ruoyi.system.service.ISysUserService;
|
import com.ruoyi.system.service.ISysUserService;
|
||||||
|
|
||||||
|
|
|
@ -9,11 +9,11 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import com.ruoyi.common.constant.Constants;
|
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.AsyncManager;
|
||||||
import com.ruoyi.framework.manager.factory.AsyncFactory;
|
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;
|
import com.ruoyi.system.domain.SysUser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -7,7 +7,8 @@ import org.apache.shiro.session.mgt.SessionFactory;
|
||||||
import org.apache.shiro.web.session.mgt.WebSessionContext;
|
import org.apache.shiro.web.session.mgt.WebSessionContext;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import com.ruoyi.common.utils.IpUtils;
|
import com.ruoyi.common.utils.IpUtils;
|
||||||
import com.ruoyi.framework.util.ServletUtils;
|
import com.ruoyi.common.utils.ServletUtils;
|
||||||
|
|
||||||
import eu.bitwalker.useragentutils.UserAgent;
|
import eu.bitwalker.useragentutils.UserAgent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -7,10 +7,10 @@ import org.apache.shiro.subject.Subject;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import com.ruoyi.common.constant.Constants;
|
import com.ruoyi.common.constant.Constants;
|
||||||
|
import com.ruoyi.common.utils.MessageUtils;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.framework.manager.AsyncManager;
|
import com.ruoyi.framework.manager.AsyncManager;
|
||||||
import com.ruoyi.framework.manager.factory.AsyncFactory;
|
import com.ruoyi.framework.manager.factory.AsyncFactory;
|
||||||
import com.ruoyi.framework.util.MessageUtils;
|
|
||||||
import com.ruoyi.framework.util.ShiroUtils;
|
import com.ruoyi.framework.util.ShiroUtils;
|
||||||
import com.ruoyi.system.domain.SysUser;
|
import com.ruoyi.system.domain.SysUser;
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.ruoyi.framework.util;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import com.ruoyi.common.constant.PermissionConstants;
|
import com.ruoyi.common.constant.PermissionConstants;
|
||||||
|
import com.ruoyi.common.utils.MessageUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* permission 工具类
|
* permission 工具类
|
||||||
|
|
|
@ -10,10 +10,10 @@ import com.github.pagehelper.PageInfo;
|
||||||
import com.ruoyi.common.base.AjaxResult;
|
import com.ruoyi.common.base.AjaxResult;
|
||||||
import com.ruoyi.common.page.PageDomain;
|
import com.ruoyi.common.page.PageDomain;
|
||||||
import com.ruoyi.common.page.TableDataInfo;
|
import com.ruoyi.common.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.page.TableSupport;
|
||||||
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.framework.util.ShiroUtils;
|
import com.ruoyi.framework.util.ShiroUtils;
|
||||||
import com.ruoyi.framework.web.page.TableSupport;
|
|
||||||
import com.ruoyi.system.domain.SysUser;
|
import com.ruoyi.system.domain.SysUser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -219,6 +219,7 @@ public class GenUtils
|
||||||
javaTypeMap.put("smallint", "Integer");
|
javaTypeMap.put("smallint", "Integer");
|
||||||
javaTypeMap.put("mediumint", "Integer");
|
javaTypeMap.put("mediumint", "Integer");
|
||||||
javaTypeMap.put("int", "Integer");
|
javaTypeMap.put("int", "Integer");
|
||||||
|
javaTypeMap.put("number", "Integer");
|
||||||
javaTypeMap.put("integer", "integer");
|
javaTypeMap.put("integer", "integer");
|
||||||
javaTypeMap.put("bigint", "Long");
|
javaTypeMap.put("bigint", "Long");
|
||||||
javaTypeMap.put("float", "Float");
|
javaTypeMap.put("float", "Float");
|
||||||
|
@ -227,6 +228,7 @@ public class GenUtils
|
||||||
javaTypeMap.put("bit", "Boolean");
|
javaTypeMap.put("bit", "Boolean");
|
||||||
javaTypeMap.put("char", "String");
|
javaTypeMap.put("char", "String");
|
||||||
javaTypeMap.put("varchar", "String");
|
javaTypeMap.put("varchar", "String");
|
||||||
|
javaTypeMap.put("varchar2", "String");
|
||||||
javaTypeMap.put("tinytext", "String");
|
javaTypeMap.put("tinytext", "String");
|
||||||
javaTypeMap.put("text", "String");
|
javaTypeMap.put("text", "String");
|
||||||
javaTypeMap.put("mediumtext", "String");
|
javaTypeMap.put("mediumtext", "String");
|
||||||
|
|
Loading…
Reference in New Issue