Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fgqyxxlr
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yaru
fgqyxxlr
Commits
791c767a
Commit
791c767a
authored
Jul 26, 2018
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
一些优化细节
parent
f6572861
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
96 additions
and
33 deletions
+96
-33
src/main/java/com/ruoyi/common/constant/CommonMap.java
+2
-2
src/main/java/com/ruoyi/common/constant/Constants.java
+4
-4
src/main/java/com/ruoyi/common/constant/PermissionConstants.java
+24
-0
src/main/java/com/ruoyi/common/exception/file/InvalidExtensionException.java
+1
-2
src/main/java/com/ruoyi/common/utils/AddressUtils.java
+1
-1
src/main/java/com/ruoyi/common/utils/StringUtils.java
+1
-1
src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
+2
-2
src/main/java/com/ruoyi/common/utils/security/PermissionUtils.java
+42
-0
src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Excel.java
+1
-1
src/main/java/com/ruoyi/framework/shiro/web/filter/LogoutFilter.java
+1
-1
src/main/java/com/ruoyi/framework/shiro/web/session/SpringSessionValidationScheduler.java
+1
-3
src/main/java/com/ruoyi/framework/web/exception/DefaultExceptionHandler.java
+2
-2
src/main/java/com/ruoyi/framework/web/page/TableSupport.java
+4
-4
src/main/java/com/ruoyi/project/monitor/job/util/ScheduleUtils.java
+9
-9
src/main/java/com/ruoyi/project/system/user/controller/ProfileController.java
+1
-1
No files found.
src/main/java/com/ruoyi/common/constant/CommonMap.java
View file @
791c767a
...
...
@@ -4,7 +4,7 @@ import java.util.HashMap;
import
java.util.Map
;
/**
* 通用Map数据
* 通用
数据库映射
Map数据
*
* @author ruoyi
*/
...
...
@@ -39,7 +39,7 @@ public class CommonMap
javaTypeMap
.
put
(
"text"
,
"String"
);
javaTypeMap
.
put
(
"mediumtext"
,
"String"
);
javaTypeMap
.
put
(
"longtext"
,
"String"
);
javaTypeMap
.
put
(
"time"
,
"Date"
);
javaTypeMap
.
put
(
"time"
,
"Date"
);
javaTypeMap
.
put
(
"date"
,
"Date"
);
javaTypeMap
.
put
(
"datetime"
,
"Date"
);
javaTypeMap
.
put
(
"timestamp"
,
"Date"
);
...
...
src/main/java/com/ruoyi/common/constant/Constants.java
View file @
791c767a
...
...
@@ -45,21 +45,21 @@ public class Constants
/**
* 当前记录起始索引
*/
public
static
String
PAGENUM
=
"pageNum"
;
public
static
String
PAGE
_
NUM
=
"pageNum"
;
/**
* 每页显示记录数
*/
public
static
String
PAGESIZE
=
"pageSize"
;
public
static
String
PAGE
_
SIZE
=
"pageSize"
;
/**
* 排序列
*/
public
static
String
ORDER
BY
COLUMN
=
"orderByColumn"
;
public
static
String
ORDER
_BY_
COLUMN
=
"orderByColumn"
;
/**
* 排序的方向 "desc" 或者 "asc".
*/
public
static
String
ISASC
=
"isAsc"
;
public
static
String
IS
_
ASC
=
"isAsc"
;
}
src/main/java/com/ruoyi/common/constant/PermissionConstants.java
0 → 100644
View file @
791c767a
package
com
.
ruoyi
.
common
.
constant
;
/**
* 权限通用常量
*
* @author ruoyi
*/
public
class
PermissionConstants
{
/** 新增权限 */
public
static
final
String
ADD_PERMISSION
=
"add"
;
/** 修改权限 */
public
static
final
String
EDIT_PERMISSION
=
"edit"
;
/** 删除权限 */
public
static
final
String
REMOVE_PERMISSION
=
"remove"
;
/** 显示权限 */
public
static
final
String
VIEW_PERMISSION
=
"view"
;
/** 查询权限 */
public
static
final
String
LIST_PERMISSION
=
"list"
;
}
src/main/java/com/ruoyi/common/exception/file/InvalidExtensionException.java
View file @
791c767a
...
...
@@ -19,8 +19,7 @@ public class InvalidExtensionException extends FileUploadException
public
InvalidExtensionException
(
String
[]
allowedExtension
,
String
extension
,
String
filename
)
{
super
(
"filename : ["
+
filename
+
"], extension : ["
+
extension
+
"], allowed extension : ["
+
Arrays
.
toString
(
allowedExtension
)
+
"]"
);
super
(
"filename : ["
+
filename
+
"], extension : ["
+
extension
+
"], allowed extension : ["
+
Arrays
.
toString
(
allowedExtension
)
+
"]"
);
this
.
allowedExtension
=
allowedExtension
;
this
.
extension
=
extension
;
this
.
filename
=
filename
;
...
...
src/main/java/com/ruoyi/common/utils/AddressUtils.java
View file @
791c767a
...
...
@@ -30,7 +30,7 @@ public class AddressUtils
}
catch
(
Exception
e
)
{
log
.
error
(
"
根据IP获取所在位置----------错误消息:"
+
e
.
getMessage
()
);
log
.
error
(
"
获取地理位置异常:"
,
e
);
}
return
address
;
}
...
...
src/main/java/com/ruoyi/common/utils/StringUtils.java
View file @
791c767a
...
...
@@ -12,7 +12,7 @@ import com.ruoyi.common.support.StrFormatter;
*
* @author ruoyi
*/
public
class
StringUtils
public
class
StringUtils
extends
org
.
apache
.
commons
.
lang3
.
StringUtils
{
/** 空字符串 */
private
static
final
String
NULLSTR
=
""
;
...
...
src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
View file @
791c767a
...
...
@@ -304,7 +304,7 @@ public class ExcelUtil<T>
}
catch
(
Exception
e
)
{
log
.
error
(
"导出Excel失败{}"
,
e
);
log
.
error
(
"导出Excel失败{}"
,
e
.
getMessage
()
);
}
}
}
...
...
@@ -319,7 +319,7 @@ public class ExcelUtil<T>
}
catch
(
Exception
e
)
{
log
.
error
(
"关闭flush失败{}"
,
e
);
log
.
error
(
"关闭flush失败{}"
,
e
.
getMessage
()
);
return
AjaxResult
.
error
(
"导出Excel失败,请联系网站管理员!"
);
}
}
...
...
src/main/java/com/ruoyi/common/utils/security/PermissionUtils.java
0 → 100644
View file @
791c767a
package
com
.
ruoyi
.
common
.
utils
.
security
;
import
org.apache.commons.lang3.StringUtils
;
import
com.ruoyi.common.constant.PermissionConstants
;
import
com.ruoyi.common.utils.MessageUtils
;
/**
* permission 工具类
*
* @author ruoyi
*/
public
class
PermissionUtils
{
/**
* 权限错误消息提醒
*
* @param errorMsg 错误信息
* @return
*/
public
static
String
getMsg
(
String
permissionsStr
)
{
String
permission
=
StringUtils
.
substringBetween
(
permissionsStr
,
"["
,
"]"
);
String
msg
=
MessageUtils
.
message
(
"no.view.permission"
,
permission
);
if
(
StringUtils
.
endsWithIgnoreCase
(
permission
,
PermissionConstants
.
ADD_PERMISSION
))
{
msg
=
MessageUtils
.
message
(
"no.create.permission"
,
permission
);
}
else
if
(
StringUtils
.
endsWithIgnoreCase
(
permission
,
PermissionConstants
.
EDIT_PERMISSION
))
{
msg
=
MessageUtils
.
message
(
"no.update.permission"
,
permission
);
}
else
if
(
StringUtils
.
endsWithIgnoreCase
(
permission
,
PermissionConstants
.
REMOVE_PERMISSION
))
{
msg
=
MessageUtils
.
message
(
"no.delete.permission"
,
permission
);
}
else
if
(
StringUtils
.
endsWithAny
(
permission
,
new
String
[]
{
PermissionConstants
.
VIEW_PERMISSION
,
PermissionConstants
.
LIST_PERMISSION
}))
{
msg
=
MessageUtils
.
message
(
"no.view.permission"
,
permission
);
}
return
msg
;
}
}
src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Excel.java
View file @
791c767a
...
...
@@ -6,7 +6,7 @@ import java.lang.annotation.RetentionPolicy;
import
java.lang.annotation.Target
;
/**
* 自定义注解
* 自定义
导出Excel数据
注解
*
* @author ruoyi
*/
...
...
src/main/java/com/ruoyi/framework/shiro/web/filter/LogoutFilter.java
View file @
791c767a
...
...
@@ -64,7 +64,7 @@ public class LogoutFilter extends org.apache.shiro.web.filter.authc.LogoutFilter
}
catch
(
Exception
e
)
{
log
.
debug
(
"Encountered session exception during logout. This can generally safely be ignored."
,
e
);
log
.
error
(
"Encountered session exception during logout. This can generally safely be ignored."
,
e
);
}
return
false
;
}
...
...
src/main/java/com/ruoyi/framework/shiro/web/session/SpringSessionValidationScheduler.java
View file @
791c767a
...
...
@@ -121,9 +121,7 @@ public class SpringSessionValidationScheduler implements SessionValidationSchedu
{
if
(
log
.
isErrorEnabled
())
{
log
.
error
(
"Error starting the Spring Scheduler session validation job. Session validation may not occur."
,
e
);
log
.
error
(
"Error starting the Spring Scheduler session validation job. Session validation may not occur."
,
e
);
}
}
}
...
...
src/main/java/com/ruoyi/framework/web/exception/DefaultExceptionHandler.java
View file @
791c767a
...
...
@@ -6,8 +6,8 @@ import org.slf4j.LoggerFactory;
import
org.springframework.web.HttpRequestMethodNotSupportedException
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.bind.annotation.RestControllerAdvice
;
import
com.ruoyi.common.exception.DemoModeException
;
import
com.ruoyi.common.utils.security.PermissionUtils
;
import
com.ruoyi.framework.web.domain.AjaxResult
;
/**
...
...
@@ -27,7 +27,7 @@ public class DefaultExceptionHandler
public
AjaxResult
handleAuthorizationException
(
AuthorizationException
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
return
AjaxResult
.
error
(
"您没有数据的权限,请联系管理员添加"
);
return
AjaxResult
.
error
(
PermissionUtils
.
getMsg
(
e
.
getMessage
())
);
}
/**
...
...
src/main/java/com/ruoyi/framework/web/page/TableSupport.java
View file @
791c767a
...
...
@@ -16,10 +16,10 @@ public class TableSupport
public
static
PageDomain
getPageDomain
()
{
PageDomain
pageDomain
=
new
PageDomain
();
pageDomain
.
setPageNum
(
ServletUtils
.
getParameterToInt
(
Constants
.
PAGENUM
));
pageDomain
.
setPageSize
(
ServletUtils
.
getParameterToInt
(
Constants
.
PAGESIZE
));
pageDomain
.
setOrderByColumn
(
ServletUtils
.
getParameter
(
Constants
.
ORDER
BY
COLUMN
));
pageDomain
.
setIsAsc
(
ServletUtils
.
getParameter
(
Constants
.
ISASC
));
pageDomain
.
setPageNum
(
ServletUtils
.
getParameterToInt
(
Constants
.
PAGE
_
NUM
));
pageDomain
.
setPageSize
(
ServletUtils
.
getParameterToInt
(
Constants
.
PAGE
_
SIZE
));
pageDomain
.
setOrderByColumn
(
ServletUtils
.
getParameter
(
Constants
.
ORDER
_BY_
COLUMN
));
pageDomain
.
setIsAsc
(
ServletUtils
.
getParameter
(
Constants
.
IS
_
ASC
));
return
pageDomain
;
}
...
...
src/main/java/com/ruoyi/project/monitor/job/util/ScheduleUtils.java
View file @
791c767a
...
...
@@ -54,7 +54,7 @@ public class ScheduleUtils
}
catch
(
SchedulerException
e
)
{
log
.
error
(
e
.
getMessage
()
);
log
.
error
(
"getCronTrigger 异常:"
,
e
);
}
return
null
;
}
...
...
@@ -89,11 +89,11 @@ public class ScheduleUtils
}
catch
(
SchedulerException
e
)
{
log
.
error
(
e
.
getMessage
()
);
log
.
error
(
"createScheduleJob 异常:"
,
e
);
}
catch
(
TaskException
e
)
{
log
.
error
(
e
.
getMessage
()
);
log
.
error
(
"createScheduleJob 异常:"
,
e
);
}
}
...
...
@@ -129,11 +129,11 @@ public class ScheduleUtils
}
catch
(
SchedulerException
e
)
{
log
.
error
(
e
.
getMessage
()
);
log
.
error
(
"SchedulerException 异常:"
,
e
);
}
catch
(
TaskException
e
)
{
log
.
error
(
e
.
getMessage
()
);
log
.
error
(
"SchedulerException 异常:"
,
e
);
}
}
...
...
@@ -154,7 +154,7 @@ public class ScheduleUtils
}
catch
(
SchedulerException
e
)
{
log
.
error
(
e
.
getMessage
()
);
log
.
error
(
"run 异常:"
,
e
);
}
return
rows
;
}
...
...
@@ -170,7 +170,7 @@ public class ScheduleUtils
}
catch
(
SchedulerException
e
)
{
log
.
error
(
e
.
getMessage
()
);
log
.
error
(
"pauseJob 异常:"
,
e
);
}
}
...
...
@@ -185,7 +185,7 @@ public class ScheduleUtils
}
catch
(
SchedulerException
e
)
{
log
.
error
(
e
.
getMessage
()
);
log
.
error
(
"resumeJob 异常:"
,
e
);
}
}
...
...
@@ -200,7 +200,7 @@ public class ScheduleUtils
}
catch
(
SchedulerException
e
)
{
log
.
error
(
e
.
getMessage
()
);
log
.
error
(
"deleteScheduleJob 异常:"
,
e
);
}
}
...
...
src/main/java/com/ruoyi/project/system/user/controller/ProfileController.java
View file @
791c767a
...
...
@@ -149,7 +149,7 @@ public class ProfileController extends BaseController
}
catch
(
Exception
e
)
{
log
.
error
(
"
updateAvatar failed!
"
,
e
);
log
.
error
(
"
修改头像失败!
"
,
e
);
return
error
(
e
.
getMessage
());
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment