mirror of https://gitee.com/y_project/RuoYi.git
排序数字校验
parent
e78dc2983f
commit
e335336064
|
@ -27,7 +27,12 @@ http://webapplayers.com/inspinia_admin-v2.7.1
|
|||
13. 在线构建器:拖动表单元素生成相应的HTML代码。
|
||||
14. 连接池监视:监视当期系统数据库连接池状态,可进行分析SQL找出系统性能瓶颈。
|
||||
|
||||
## 系统演示 [www.ruoyi.club](http://www.ruoyi.club)
|
||||
## 在线体验
|
||||
> admin/admin123
|
||||
|
||||
地址:http://www.ruoyi.club
|
||||
|
||||
## 演示图
|
||||
|
||||

|
||||
|
||||
|
|
|
@ -160,7 +160,7 @@ insert into sys_menu values('12', '登录日志', '2', '2', '/monitor/logininfo
|
|||
insert into sys_menu values('13', '在线用户', '2', '3', '/monitor/online', 'C', '0', 'monitor:online:view', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '在线用户菜单');
|
||||
insert into sys_menu values('14', '定时任务', '2', '4', '/monitor/job', 'C', '0', 'monitor:job:view', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '定时任务菜单');
|
||||
insert into sys_menu values('15', '数据监控', '2', '5', '/monitor/data', 'C', '0', 'monitor:data:view', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '数据监控菜单');
|
||||
insert into sys_menu values('16', '系统接口API', '2', '6', '/swagger-ui.html', 'C', '0', 'onitor:api:view', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '系统API菜单');
|
||||
insert into sys_menu values('16', '系统接口', '2', '6', '/swagger-ui.html', 'C', '0', 'onitor:api:view', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '系统API菜单');
|
||||
insert into sys_menu values('17', '表单构建', '3', '1', '/tool/build', 'C', '0', 'tool:build:view', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '表单构建菜单');
|
||||
insert into sys_menu values('18', '代码生成', '3', '2', '/tool/gen', 'C', '0', 'tool:gen:view', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '代码生成菜单');
|
||||
-- 用户管理按钮
|
||||
|
@ -374,7 +374,7 @@ create table sys_oper_log (
|
|||
dept_name varchar(50) default '' comment '部门名称',
|
||||
oper_url varchar(255) default '' comment '请求URL',
|
||||
oper_ip varchar(30) default '' comment '主机地址',
|
||||
oper_location varchar(255) default '' comment '操作地点',
|
||||
oper_location varchar(255) default '' comment '操作地点',
|
||||
oper_param varchar(255) default '' comment '请求参数',
|
||||
status int(1) default 0 comment '操作状态 0正常 1异常',
|
||||
error_msg varchar(2000) default '' comment '错误消息',
|
||||
|
@ -475,15 +475,15 @@ insert into sys_config values(2, '用户管理-账号初始密码', 'sys.use
|
|||
-- ----------------------------
|
||||
drop table if exists sys_logininfor;
|
||||
create table sys_logininfor (
|
||||
info_id int(11) not null auto_increment comment '访问ID',
|
||||
login_name varchar(50) default '' comment '登录账号',
|
||||
ipaddr varchar(50) default '' comment '登录IP地址',
|
||||
login_location varchar(255) default '' comment '登录地点',
|
||||
browser varchar(50) default '' comment '浏览器类型',
|
||||
os varchar(50) default '' comment '操作系统',
|
||||
status int(1) default 0 comment '登录状态 0成功 1失败',
|
||||
msg varchar(255) default '' comment '提示消息',
|
||||
login_time datetime comment '访问时间',
|
||||
info_id int(11) not null auto_increment comment '访问ID',
|
||||
login_name varchar(50) default '' comment '登录账号',
|
||||
ipaddr varchar(50) default '' comment '登录IP地址',
|
||||
login_location varchar(255) default '' comment '登录地点',
|
||||
browser varchar(50) default '' comment '浏览器类型',
|
||||
os varchar(50) default '' comment '操作系统',
|
||||
status int(1) default 0 comment '登录状态 0成功 1失败',
|
||||
msg varchar(255) default '' comment '提示消息',
|
||||
login_time datetime comment '访问时间',
|
||||
primary key (info_id)
|
||||
) engine=innodb auto_increment=100 default charset=utf8 comment = '系统访问记录';
|
||||
|
||||
|
@ -497,7 +497,7 @@ create table sys_user_online (
|
|||
login_name varchar(50) default '' comment '登录账号',
|
||||
dept_name varchar(50) default '' comment '部门名称',
|
||||
ipaddr varchar(50) default '' comment '登录IP地址',
|
||||
login_location varchar(255) default '' comment '登录地点',
|
||||
login_location varchar(255) default '' comment '登录地点',
|
||||
browser varchar(50) default '' comment '浏览器类型',
|
||||
os varchar(50) default '' comment '操作系统',
|
||||
status varchar(10) default '' comment '在线状态on_line在线off_line离线',
|
|
@ -5,8 +5,12 @@ package com.ruoyi.common.constant;
|
|||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class CommonConstant
|
||||
public class Constants
|
||||
{
|
||||
/**
|
||||
* UTF-8 字符集
|
||||
*/
|
||||
public static final String UTF8 = "UTF-8";
|
||||
|
||||
/**
|
||||
* 通用成功标识
|
|
@ -1,46 +1,42 @@
|
|||
package com.ruoyi.common.utils;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* 获取地址类
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class AddressUtils {
|
||||
public static String getAddresses(String content, String encodingString) throws UnsupportedEncodingException {
|
||||
/** 根据IP查询地址 http://ip.taobao.com/service/getIpInfo.php?ip=111.111.111.111*/
|
||||
String urlStr = "http://ip.taobao.com/service/getIpInfo.php";
|
||||
String returnStr = getResult(urlStr, content, encodingString);
|
||||
if (returnStr != null) {
|
||||
returnStr = decodeUnicode(returnStr);
|
||||
String[] temp = returnStr.split(",");
|
||||
if (temp.length < 3) {
|
||||
return "0";
|
||||
}
|
||||
return returnStr;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public class AddressUtils
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(AddressUtils.class);
|
||||
|
||||
public static final String IP_URL = "http://ip.taobao.com/service/getIpInfo.php";
|
||||
|
||||
/**
|
||||
* 获取查询结果
|
||||
*
|
||||
* @param urlStr
|
||||
* @param content
|
||||
* @param encoding
|
||||
* @return
|
||||
*/
|
||||
private static String getResult(String urlStr, String content, String encoding) {
|
||||
private static String sendPost(String content, String encoding)
|
||||
{
|
||||
URL url = null;
|
||||
HttpURLConnection connection = null;
|
||||
try {
|
||||
url = new URL(urlStr);
|
||||
try
|
||||
{
|
||||
url = new URL(IP_URL);
|
||||
connection = (HttpURLConnection) url.openConnection();
|
||||
connection.setConnectTimeout(2000);
|
||||
connection.setReadTimeout(2000);
|
||||
|
@ -56,120 +52,45 @@ public class AddressUtils {
|
|||
BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), encoding));
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
String line = "";
|
||||
while ((line = reader.readLine()) != null) {
|
||||
while ((line = reader.readLine()) != null)
|
||||
{
|
||||
buffer.append(line);
|
||||
}
|
||||
reader.close();
|
||||
return buffer.toString();
|
||||
} catch (IOException e) {
|
||||
System.out.println("温馨提醒:您的主机已经断网,请您检查主机的网络连接");
|
||||
System.out.println("根据IP获取所在位置----------错误消息:"+e.getMessage());
|
||||
} finally {
|
||||
if (connection != null) {
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
log.error("温馨提醒:您的主机已经断网,请您检查主机的网络连接");
|
||||
log.error("根据IP获取所在位置----------错误消息:" + e.getMessage());
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (connection != null)
|
||||
{
|
||||
connection.disconnect();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param theString
|
||||
* @return
|
||||
*/
|
||||
public static String decodeUnicode(String theString) {
|
||||
char aChar;
|
||||
int len = theString.length();
|
||||
StringBuffer outBuffer = new StringBuffer(len);
|
||||
for (int x = 0; x < len;) {
|
||||
aChar = theString.charAt(x++);
|
||||
if (aChar == '\\') {
|
||||
aChar = theString.charAt(x++);
|
||||
if (aChar == 'u') {
|
||||
int value = 0;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
aChar = theString.charAt(x++);
|
||||
switch (aChar) {
|
||||
case '0':
|
||||
case '1':
|
||||
case '2':
|
||||
case '3':
|
||||
case '4':
|
||||
case '5':
|
||||
case '6':
|
||||
case '7':
|
||||
case '8':
|
||||
case '9':
|
||||
value = (value << 4) + aChar - '0';
|
||||
break;
|
||||
case 'a':
|
||||
case 'b':
|
||||
case 'c':
|
||||
case 'd':
|
||||
case 'e':
|
||||
case 'f':
|
||||
value = (value << 4) + 10 + aChar - 'a';
|
||||
break;
|
||||
case 'A':
|
||||
case 'B':
|
||||
case 'C':
|
||||
case 'D':
|
||||
case 'E':
|
||||
case 'F':
|
||||
value = (value << 4) + 10 + aChar - 'A';
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("Malformed encoding.");
|
||||
}
|
||||
}
|
||||
outBuffer.append((char) value);
|
||||
} else {
|
||||
if (aChar == 't') {
|
||||
aChar = '\t';
|
||||
} else if (aChar == 'r') {
|
||||
aChar = '\r';
|
||||
} else if (aChar == 'n') {
|
||||
aChar = '\n';
|
||||
} else if (aChar == 'f') {
|
||||
aChar = '\f';
|
||||
}
|
||||
outBuffer.append(aChar);
|
||||
}
|
||||
} else {
|
||||
outBuffer.append(aChar);
|
||||
}
|
||||
}
|
||||
return outBuffer.toString();
|
||||
}
|
||||
|
||||
public static String getRealAddressByIP(String ip) {
|
||||
public static String getRealAddressByIP(String ip)
|
||||
{
|
||||
String address = "";
|
||||
try {
|
||||
try
|
||||
{
|
||||
address = sendPost("ip=" + ip, Constants.UTF8);
|
||||
|
||||
address = getAddresses("ip=" + ip, "utf-8");
|
||||
|
||||
////把JSON文本parse成JSONObject,通俗就是把json文本转为json对象
|
||||
JSONObject json= JSONObject.parseObject(address);
|
||||
|
||||
//通过其get的方法来获取data的value由于返回的是object对象,而data的value本身又是json字符串,所以我们可以进行强转
|
||||
JSONObject object = (JSONObject)json.get("data");
|
||||
String country=object.getString("country");
|
||||
JSONObject json = JSONObject.parseObject(address);
|
||||
JSONObject object = json.getObject("data", JSONObject.class);
|
||||
String region = object.getString("region");
|
||||
String city = object.getString("city");
|
||||
address = country+""+region + "" + city;
|
||||
} catch (Exception e) {
|
||||
|
||||
address = region + " " + city;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.error("根据IP获取所在位置----------错误消息:" + e.getMessage());
|
||||
}
|
||||
return address;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
System.out.println(getAddresses("ip=111.85.32.37","utf-8"));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
System.out.println(getRealAddressByIP("111.85.32.37"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,6 +38,6 @@ public class IpUtils
|
|||
ip = request.getRemoteAddr();
|
||||
}
|
||||
|
||||
return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip;
|
||||
return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package com.ruoyi.common.utils;
|
|||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import com.ruoyi.common.constant.CommonConstant;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.utils.security.ShiroUtils;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.project.monitor.logininfor.domain.Logininfor;
|
||||
|
@ -40,13 +40,13 @@ public class SystemLogUtils
|
|||
|
||||
sys_user_logger.info(s.toString(), args);
|
||||
|
||||
if (CommonConstant.LOGIN_SUCCESS.equals(status) || CommonConstant.LOGOUT.equals(status))
|
||||
if (Constants.LOGIN_SUCCESS.equals(status) || Constants.LOGOUT.equals(status))
|
||||
{
|
||||
saveOpLog(username, msg, CommonConstant.SUCCESS);
|
||||
saveOpLog(username, msg, Constants.SUCCESS);
|
||||
}
|
||||
else if (CommonConstant.LOGIN_FAIL.equals(status))
|
||||
else if (Constants.LOGIN_FAIL.equals(status))
|
||||
{
|
||||
saveOpLog(username, msg, CommonConstant.FAIL);
|
||||
saveOpLog(username, msg, Constants.FAIL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ public class LogAspect
|
|||
// 请求的地址
|
||||
String ip = ShiroUtils.getIp();
|
||||
operLog.setOperIp(ip);
|
||||
//操作地点
|
||||
// 操作地点
|
||||
operLog.setOperLocation(AddressUtils.getRealAddressByIP(ip));
|
||||
|
||||
operLog.setOperUrl(ServletUtils.getRequest().getRequestURI());
|
||||
|
|
|
@ -15,7 +15,6 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
|
|||
@Configuration
|
||||
public class ResourcesConfig extends WebMvcConfigurerAdapter
|
||||
{
|
||||
|
||||
/**
|
||||
* 首页地址
|
||||
*/
|
||||
|
@ -38,7 +37,7 @@ public class ResourcesConfig extends WebMvcConfigurerAdapter
|
|||
{
|
||||
registry.addResourceHandler("/profile/**").addResourceLocations("file:" + RuoYiConfig.getProfile());
|
||||
|
||||
/**swagger配置*/
|
||||
/** swagger配置 */
|
||||
registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");
|
||||
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
|
||||
}
|
||||
|
|
|
@ -262,6 +262,7 @@ public class ShiroConfig
|
|||
filterChainDefinitionMap.put("/main", "onlineSession,syncOnlineSession");
|
||||
filterChainDefinitionMap.put("/system/**", "onlineSession,syncOnlineSession");
|
||||
filterChainDefinitionMap.put("/monitor/**", "onlineSession,syncOnlineSession");
|
||||
filterChainDefinitionMap.put("/tool/**", "onlineSession,syncOnlineSession");
|
||||
shiroFilterFactoryBean.setFilterChainDefinitionMap(filterChainDefinitionMap);
|
||||
|
||||
return shiroFilterFactoryBean;
|
||||
|
|
|
@ -14,40 +14,46 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
|||
|
||||
/**
|
||||
* Swagger2的接口配置
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Configuration
|
||||
@EnableSwagger2
|
||||
public class SwaggerConfig {
|
||||
/** 系统基础配置*/
|
||||
public class SwaggerConfig
|
||||
{
|
||||
/** 系统基础配置 */
|
||||
@Autowired
|
||||
private RuoYiConfig ruoYiConfig;
|
||||
|
||||
/**
|
||||
* 创建API
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public Docket createRestApi() {
|
||||
public Docket createRestApi()
|
||||
{
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
//详细定制
|
||||
// 详细定制
|
||||
.apiInfo(apiInfo())
|
||||
.select()
|
||||
//.apis(RequestHandlerSelectors.basePackage("com.ruoyi.project.*.*.controller"))
|
||||
//扫描所有
|
||||
.apis(RequestHandlerSelectors.any())
|
||||
// 指定当前包路径
|
||||
.apis(RequestHandlerSelectors.basePackage("com.ruoyi.project.system.post.controller"))
|
||||
// 扫描所有 .apis(RequestHandlerSelectors.any())
|
||||
.paths(PathSelectors.any())
|
||||
.build();
|
||||
}
|
||||
|
||||
private ApiInfo apiInfo() {
|
||||
/**
|
||||
* 添加摘要信息
|
||||
*/
|
||||
private ApiInfo apiInfo()
|
||||
{
|
||||
// 用ApiInfoBuilder进行定制
|
||||
return new ApiInfoBuilder()
|
||||
.title("系统接口列表")
|
||||
.description("API接口测试平台\",\n" +
|
||||
" \"提供后台所有Restful接口\",")
|
||||
.title("标题:若依管理系统_接口文档")
|
||||
.description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
|
||||
.termsOfServiceUrl("http://localhost/swagger-ui.html")
|
||||
.contact(new Contact(ruoYiConfig.getName(), "https://gitee.com/y_project/RuoYi", "1403014932@qq.com"))
|
||||
.version("1.1.0")
|
||||
.contact(new Contact(ruoYiConfig.getName(), null, null))
|
||||
.version("版本号:" + ruoYiConfig.getVersion())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ package com.ruoyi.framework.shiro.service;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.StringUtils;
|
||||
import com.ruoyi.common.constant.CommonConstant;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.constant.ShiroConstants;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.exception.user.CaptchaException;
|
||||
|
@ -41,20 +41,20 @@ public class LoginService
|
|||
// 验证码校验
|
||||
if (!StringUtils.isEmpty(ServletUtils.getStrAttribute(ShiroConstants.CURRENT_CAPTCHA)))
|
||||
{
|
||||
SystemLogUtils.log(username, CommonConstant.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error"));
|
||||
SystemLogUtils.log(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error"));
|
||||
throw new CaptchaException();
|
||||
}
|
||||
// 用户名或密码为空 错误
|
||||
if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password))
|
||||
{
|
||||
SystemLogUtils.log(username, CommonConstant.LOGIN_FAIL, MessageUtils.message("not.null"));
|
||||
SystemLogUtils.log(username, Constants.LOGIN_FAIL, MessageUtils.message("not.null"));
|
||||
throw new UserNotExistsException();
|
||||
}
|
||||
// 密码如果不在指定范围内 错误
|
||||
if (password.length() < UserConstants.PASSWORD_MIN_LENGTH
|
||||
|| password.length() > UserConstants.PASSWORD_MAX_LENGTH)
|
||||
{
|
||||
SystemLogUtils.log(username, CommonConstant.LOGIN_FAIL, MessageUtils.message("user.password.not.match"));
|
||||
SystemLogUtils.log(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match"));
|
||||
throw new UserPasswordNotMatchException();
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ public class LoginService
|
|||
if (username.length() < UserConstants.USERNAME_MIN_LENGTH
|
||||
|| username.length() > UserConstants.USERNAME_MAX_LENGTH)
|
||||
{
|
||||
SystemLogUtils.log(username, CommonConstant.LOGIN_FAIL, MessageUtils.message("user.password.not.match"));
|
||||
SystemLogUtils.log(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match"));
|
||||
throw new UserPasswordNotMatchException();
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,7 @@ public class LoginService
|
|||
|
||||
if (user == null || UserStatus.DELETED.getCode() == user.getStatus())
|
||||
{
|
||||
SystemLogUtils.log(username, CommonConstant.LOGIN_FAIL, MessageUtils.message("user.not.exists"));
|
||||
SystemLogUtils.log(username, Constants.LOGIN_FAIL, MessageUtils.message("user.not.exists"));
|
||||
throw new UserNotExistsException();
|
||||
}
|
||||
|
||||
|
@ -89,10 +89,10 @@ public class LoginService
|
|||
|
||||
if (UserStatus.DISABLE.getCode() == user.getStatus())
|
||||
{
|
||||
SystemLogUtils.log(username, CommonConstant.LOGIN_FAIL, MessageUtils.message("user.blocked", user.getRemark()));
|
||||
SystemLogUtils.log(username, Constants.LOGIN_FAIL, MessageUtils.message("user.blocked", user.getRemark()));
|
||||
throw new UserBlockedException(user.getRemark());
|
||||
}
|
||||
SystemLogUtils.log(username, CommonConstant.LOGIN_SUCCESS, MessageUtils.message("user.login.success"));
|
||||
SystemLogUtils.log(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success"));
|
||||
recordLoginInfo(user);
|
||||
return user;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.ruoyi.common.constant.CommonConstant;
|
||||
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;
|
||||
|
@ -52,13 +52,13 @@ public class PasswordService
|
|||
}
|
||||
if (retryCount.incrementAndGet() > Integer.valueOf(maxRetryCount).intValue())
|
||||
{
|
||||
SystemLogUtils.log(loginName, CommonConstant.LOGIN_FAIL, MessageUtils.message("user.password.retry.limit.exceed", maxRetryCount));
|
||||
SystemLogUtils.log(loginName, Constants.LOGIN_FAIL, MessageUtils.message("user.password.retry.limit.exceed", maxRetryCount));
|
||||
throw new UserPasswordRetryLimitExceedException(Integer.valueOf(maxRetryCount).intValue());
|
||||
}
|
||||
|
||||
if (!matches(user, password))
|
||||
{
|
||||
SystemLogUtils.log(loginName, CommonConstant.LOGIN_FAIL, MessageUtils.message("user.password.retry.limit.count", retryCount, password));
|
||||
SystemLogUtils.log(loginName, Constants.LOGIN_FAIL, MessageUtils.message("user.password.retry.limit.count", retryCount, password));
|
||||
loginRecordCache.put(loginName, retryCount);
|
||||
throw new UserPasswordNotMatchException();
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ import org.apache.shiro.session.SessionException;
|
|||
import org.apache.shiro.subject.Subject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import com.ruoyi.common.constant.CommonConstant;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.utils.MessageUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.SystemLogUtils;
|
||||
|
@ -51,7 +51,7 @@ public class LogoutFilter extends org.apache.shiro.web.filter.authc.LogoutFilter
|
|||
{
|
||||
String loginName = user.getLoginName();
|
||||
// 记录用户退出日志
|
||||
SystemLogUtils.log(loginName, CommonConstant.LOGOUT, MessageUtils.message("user.logout.success"));
|
||||
SystemLogUtils.log(loginName, Constants.LOGOUT, MessageUtils.message("user.logout.success"));
|
||||
}
|
||||
// 退出登录
|
||||
subject.logout();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.ruoyi.framework.web.page;
|
||||
|
||||
import com.ruoyi.common.utils.ServletUtils;
|
||||
import com.ruoyi.common.constant.CommonConstant;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
|
||||
/**
|
||||
* 表格数据处理
|
||||
|
@ -16,10 +16,10 @@ public class TableSupport
|
|||
public static PageDomain getPageDomain()
|
||||
{
|
||||
PageDomain pageDomain = new PageDomain();
|
||||
pageDomain.setPageNum(ServletUtils.getIntParameter(CommonConstant.PAGENUM));
|
||||
pageDomain.setPageSize(ServletUtils.getIntParameter(CommonConstant.PAGESIZE));
|
||||
pageDomain.setOrderByColumn(ServletUtils.getStrParameter(CommonConstant.ORDERBYCOLUMN));
|
||||
pageDomain.setIsAsc(ServletUtils.getStrParameter(CommonConstant.ISASC));
|
||||
pageDomain.setPageNum(ServletUtils.getIntParameter(Constants.PAGENUM));
|
||||
pageDomain.setPageSize(ServletUtils.getIntParameter(Constants.PAGESIZE));
|
||||
pageDomain.setOrderByColumn(ServletUtils.getStrParameter(Constants.ORDERBYCOLUMN));
|
||||
pageDomain.setIsAsc(ServletUtils.getStrParameter(Constants.ISASC));
|
||||
return pageDomain;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.ruoyi.project.monitor.logininfor.domain;
|
||||
|
||||
import com.ruoyi.framework.web.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
@ -20,8 +19,8 @@ public class Logininfor extends BaseEntity
|
|||
private String status;
|
||||
/** 登录IP地址 */
|
||||
private String ipaddr;
|
||||
/**登录地点*/
|
||||
private String loginLocation;
|
||||
/** 登录地点 */
|
||||
private String loginLocation;
|
||||
/** 浏览器类型 */
|
||||
private String browser;
|
||||
/** 操作系统 */
|
||||
|
@ -71,11 +70,13 @@ public class Logininfor extends BaseEntity
|
|||
this.ipaddr = ipaddr;
|
||||
}
|
||||
|
||||
public String getLoginLocation() {
|
||||
public String getLoginLocation()
|
||||
{
|
||||
return loginLocation;
|
||||
}
|
||||
|
||||
public void setLoginLocation(String loginLocation) {
|
||||
public void setLoginLocation(String loginLocation)
|
||||
{
|
||||
this.loginLocation = loginLocation;
|
||||
}
|
||||
|
||||
|
@ -123,7 +124,8 @@ public class Logininfor extends BaseEntity
|
|||
public String toString()
|
||||
{
|
||||
return "Logininfor [infoId=" + infoId + ", loginName=" + loginName + ", status=" + status + ", ipaddr=" + ipaddr
|
||||
+ ",loginLocation="+loginLocation+", browser=" + browser + ", os=" + os + ", msg=" + msg + ", loginTime=" + loginTime + "]";
|
||||
+ ",loginLocation=" + loginLocation + ", browser=" + browser + ", os=" + os + ", msg=" + msg
|
||||
+ ", loginTime=" + loginTime + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -3,7 +3,6 @@ package com.ruoyi.project.monitor.online.domain;
|
|||
import com.ruoyi.common.utils.AddressUtils;
|
||||
import com.ruoyi.framework.web.domain.BaseEntity;
|
||||
import com.ruoyi.project.monitor.online.domain.OnlineSession.OnlineStatus;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
@ -26,7 +25,7 @@ public class UserOnline extends BaseEntity
|
|||
/** 登录IP地址 */
|
||||
private String ipaddr;
|
||||
|
||||
/**登录地址*/
|
||||
/** 登录地址 */
|
||||
private String longinLocation;
|
||||
|
||||
/** 浏览器类型 */
|
||||
|
@ -111,11 +110,13 @@ public class UserOnline extends BaseEntity
|
|||
this.ipaddr = ipaddr;
|
||||
}
|
||||
|
||||
public String getLonginLocation() {
|
||||
public String getLonginLocation()
|
||||
{
|
||||
return longinLocation;
|
||||
}
|
||||
|
||||
public void setLonginLocation(String longinLocation) {
|
||||
public void setLonginLocation(String longinLocation)
|
||||
{
|
||||
this.longinLocation = longinLocation;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.ruoyi.project.monitor.operlog.domain;
|
||||
|
||||
import com.ruoyi.framework.web.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
@ -30,8 +29,8 @@ public class OperLog extends BaseEntity
|
|||
private String operUrl;
|
||||
/** 操作地址 */
|
||||
private String operIp;
|
||||
/** 操作地点*/
|
||||
private String operLocation;
|
||||
/** 操作地点 */
|
||||
private String operLocation;
|
||||
/** 请求参数 */
|
||||
private String operParam;
|
||||
/** 状态0正常 1异常 */
|
||||
|
@ -131,11 +130,13 @@ public class OperLog extends BaseEntity
|
|||
this.operIp = operIp;
|
||||
}
|
||||
|
||||
public String getOperLocation() {
|
||||
public String getOperLocation()
|
||||
{
|
||||
return operLocation;
|
||||
}
|
||||
|
||||
public void setOperLocation(String operLocation) {
|
||||
public void setOperLocation(String operLocation)
|
||||
{
|
||||
this.operLocation = operLocation;
|
||||
}
|
||||
|
||||
|
@ -184,8 +185,8 @@ public class OperLog extends BaseEntity
|
|||
{
|
||||
return "OperLog [operId=" + operId + ", title=" + title + ", action=" + action + ", method=" + method
|
||||
+ ", channel=" + channel + ", loginName=" + loginName + ", deptName=" + deptName + ", operUrl="
|
||||
+ operUrl + ", operIp=" + operIp + ", operLocation=" + operLocation + ", operParam=" + operParam + ", status=" + status + ", errorMsg="
|
||||
+ errorMsg + ", operTime=" + operTime + "]";
|
||||
+ operUrl + ", operIp=" + operIp + ", operLocation=" + operLocation + ", operParam=" + operParam
|
||||
+ ", status=" + status + ", errorMsg=" + errorMsg + ", operTime=" + operTime + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -12,6 +12,8 @@ import org.apache.velocity.VelocityContext;
|
|||
import org.apache.velocity.app.Velocity;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.exception.base.BaseException;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.framework.config.GenConfig;
|
||||
|
@ -116,13 +118,13 @@ public class GenServiceImpl implements IGenService
|
|||
{
|
||||
// 渲染模板
|
||||
StringWriter sw = new StringWriter();
|
||||
Template tpl = Velocity.getTemplate(template, "UTF-8");
|
||||
Template tpl = Velocity.getTemplate(template, Constants.UTF8);
|
||||
tpl.merge(context, sw);
|
||||
try
|
||||
{
|
||||
// 添加到zip
|
||||
zip.putNextEntry(new ZipEntry(GenUtils.getFileName(template, table, moduleName)));
|
||||
IOUtils.write(sw.toString(), zip, "UTF-8");
|
||||
IOUtils.write(sw.toString(), zip, Constants.UTF8);
|
||||
IOUtils.closeQuietly(sw);
|
||||
zip.closeEntry();
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ package com.ruoyi.project.tool.gen.util;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.apache.velocity.VelocityContext;
|
||||
import com.ruoyi.common.constant.CommonConstant;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.constant.CommonMap;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
|
@ -105,7 +105,7 @@ public class GenUtils
|
|||
*/
|
||||
public static String tableToJava(String tableName)
|
||||
{
|
||||
if (CommonConstant.AUTO_REOMVE_PRE.equals(GenConfig.getAutoRemovePre()))
|
||||
if (Constants.AUTO_REOMVE_PRE.equals(GenConfig.getAutoRemovePre()))
|
||||
{
|
||||
tableName = tableName.substring(tableName.indexOf("_") + 1);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,8 @@ package com.ruoyi.project.tool.gen.util;
|
|||
import java.util.Properties;
|
||||
import org.apache.velocity.app.Velocity;
|
||||
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
|
||||
/**
|
||||
* VelocityEngine工厂
|
||||
*
|
||||
|
@ -21,8 +23,8 @@ public class VelocityInitializer
|
|||
// 加载classpath目录下的vm文件
|
||||
p.setProperty("file.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
|
||||
// 定义字符集
|
||||
p.setProperty(Velocity.ENCODING_DEFAULT, "UTF-8");
|
||||
p.setProperty(Velocity.OUTPUT_ENCODING, "UTF-8");
|
||||
p.setProperty(Velocity.ENCODING_DEFAULT, Constants.UTF8);
|
||||
p.setProperty(Velocity.OUTPUT_ENCODING, Constants.UTF8);
|
||||
// 初始化Velocity引擎,指定配置Properties
|
||||
Velocity.init(p);
|
||||
}
|
||||
|
|
|
@ -5,15 +5,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<mapper namespace="com.ruoyi.project.monitor.logininfor.mapper.LogininforMapper">
|
||||
|
||||
<resultMap type="Logininfor" id="LogininforResult">
|
||||
<id property="infoId" column="info_id" />
|
||||
<result property="loginName" column="login_name" />
|
||||
<result property="status" column="status" />
|
||||
<result property="ipaddr" column="ipaddr" />
|
||||
<result property="loginLocation" column="login_location" />
|
||||
<result property="browser" column="browser" />
|
||||
<result property="os" column="os" />
|
||||
<result property="msg" column="msg" />
|
||||
<result property="loginTime" column="login_time" />
|
||||
<id property="infoId" column="info_id" />
|
||||
<result property="loginName" column="login_name" />
|
||||
<result property="status" column="status" />
|
||||
<result property="ipaddr" column="ipaddr" />
|
||||
<result property="loginLocation" column="login_location" />
|
||||
<result property="browser" column="browser" />
|
||||
<result property="os" column="os" />
|
||||
<result property="msg" column="msg" />
|
||||
<result property="loginTime" column="login_time" />
|
||||
</resultMap>
|
||||
|
||||
<insert id="insertLogininfor" parameterType="Logininfor">
|
||||
|
|
|
@ -9,13 +9,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="loginName" column="login_name" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
<result property="ipaddr" column="ipaddr" />
|
||||
<result property="longinLocation" column="login_location" />
|
||||
<result property="longinLocation" column="login_location" />
|
||||
<result property="browser" column="browser" />
|
||||
<result property="os" column="os" />
|
||||
<result property="status" column="status" />
|
||||
<result property="startTimestamp" column="start_timestsamp" />
|
||||
<result property="lastAccessTime" column="last_access_time" />
|
||||
<result property="expireTime" column="expire_time" />
|
||||
<result property="expireTime" column="expire_time" />
|
||||
<association property="session" javaType="OnlineSession" resultMap="OnlineSessionResult" />
|
||||
</resultMap>
|
||||
|
||||
|
|
|
@ -12,9 +12,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="channel" column="channel" />
|
||||
<result property="loginName" column="login_name" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
<result property="operUrl" column="oper_url" />
|
||||
<result property="operIp" column="oper_ip" />
|
||||
<result property="operLocation" column="oper_location" />
|
||||
<result property="operUrl" column="oper_url" />
|
||||
<result property="operIp" column="oper_ip" />
|
||||
<result property="operLocation" column="oper_location" />
|
||||
<result property="operParam" column="oper_param" />
|
||||
<result property="status" column="status" />
|
||||
<result property="errorMsg" column="error_msg" />
|
||||
|
|
|
@ -119,7 +119,7 @@ $(function(){
|
|||
search: true, // 是否显示搜索框功能
|
||||
singleSelect: false, // 是否禁止多选
|
||||
iconSize: 'outline', // 图标大小:undefined默认的按钮尺寸 xs超小按钮sm小按钮lg大按钮
|
||||
toolbar: '#toolbar', // 指定工作栏
|
||||
toolbar: '#toolbar', // 指定工作栏
|
||||
sidePagination: "server", // 启用服务端分页
|
||||
showRefresh: true, // 是否显示刷新按钮
|
||||
showColumns: true, // 是否显示隐藏某列下拉框
|
||||
|
|
|
@ -6,6 +6,10 @@ $("#form-dict-add").validate({
|
|||
dictValue:{
|
||||
required:true,
|
||||
},
|
||||
dictSort:{
|
||||
required:true,
|
||||
digits:true
|
||||
},
|
||||
},
|
||||
submitHandler:function(form){
|
||||
add();
|
||||
|
|
|
@ -6,6 +6,10 @@ $("#form-dict-edit").validate({
|
|||
dictValue:{
|
||||
required:true,
|
||||
},
|
||||
dictSort:{
|
||||
required:true,
|
||||
digits:true
|
||||
},
|
||||
},
|
||||
submitHandler:function(form){
|
||||
update();
|
||||
|
|
|
@ -8,6 +8,7 @@ $("#form-post-add").validate({
|
|||
},
|
||||
postSort:{
|
||||
required:true,
|
||||
digits:true
|
||||
},
|
||||
},
|
||||
submitHandler:function(form){
|
||||
|
|
|
@ -8,6 +8,7 @@ $("#form-post-edit").validate({
|
|||
},
|
||||
postSort:{
|
||||
required:true,
|
||||
digits:true
|
||||
},
|
||||
},
|
||||
submitHandler:function(form){
|
||||
|
|
|
@ -40,6 +40,7 @@ $("#form-role-add").validate({
|
|||
},
|
||||
roleSort:{
|
||||
required:true,
|
||||
digits:true
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
|
|
|
@ -43,6 +43,7 @@ $("#form-role-edit").validate({
|
|||
},
|
||||
roleSort:{
|
||||
required:true,
|
||||
digits:true
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
|
|
|
@ -10,9 +10,11 @@ import org.springframework.test.context.junit4.SpringRunner;
|
|||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
public class RuoYiApplicationTests {
|
||||
public class RuoYiApplicationTests
|
||||
{
|
||||
@Test
|
||||
public void contextLoads() {
|
||||
public void contextLoads()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue