Skip to content

Commit ac4c980

Browse files
committed
按照Alibaba Java Coding Guidelines插件扫描结果,修改代码规范,删除无用注释
1 parent d00eb23 commit ac4c980

File tree

7 files changed

+7
-64
lines changed

7 files changed

+7
-64
lines changed

src/main/java/com/wang/config/shiro/jwt/JwtFilter.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ protected boolean isAccessAllowed(ServletRequest request, ServletResponse respon
5656
Throwable throwable = e.getCause();
5757
if(throwable != null && throwable instanceof SignatureVerificationException ){
5858
// 该异常为JWT的AccessToken认证失败(Token或者密钥不正确)
59-
// throw (SignatureVerificationException) throwable;
6059
msg = "Token或者密钥不正确(" + throwable.getMessage() + ")";
6160
} else if(throwable != null && throwable instanceof TokenExpiredException){
6261
// 该异常为JWT的AccessToken已过期,判断RefreshToken未过期就进行AccessToken刷新

src/main/java/com/wang/controller/UserController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public ResponseBean add(@Validated(UserEditValidGroup.class) @RequestBody UserDt
210210
}
211211
userDto.setRegTime(new Date());
212212
// 密码以帐号+密码的形式进行AES加密
213-
if(userDto.getPassword().length() > 8){
213+
if(userDto.getPassword().length() > Constant.PASSWORD_MAX_LEN){
214214
throw new CustomException("密码最多8位(Password up to 8 bits.)");
215215
}
216216
String key = AesCipherUtil.enCrypto(userDto.getAccount() + userDto.getPassword());
@@ -244,7 +244,7 @@ public ResponseBean update(@Validated(UserEditValidGroup.class) @RequestBody Use
244244
// FIXME: 如果不一样就说明用户修改了密码,重新加密密码(这个处理不太好,但是没有想到好的处理方式)
245245
if(!userDtoTemp.getPassword().equals(userDto.getPassword())){
246246
// 密码以帐号+密码的形式进行AES加密
247-
if(userDto.getPassword().length() > 8){
247+
if(userDto.getPassword().length() > Constant.PASSWORD_MAX_LEN){
248248
throw new CustomException("密码最多8位(Password up to 8 bits.)");
249249
}
250250
String key = AesCipherUtil.enCrypto(userDto.getAccount() + userDto.getPassword());

src/main/java/com/wang/model/common/Constant.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,6 @@
66
* @date 2018/9/3 16:03
77
*/
88
public class Constant {
9-
/**
10-
* 1
11-
*/
12-
public static final Integer INTEGER_1 = 1;
13-
14-
/**
15-
* 2
16-
*/
17-
public static final Integer INTEGER_2 = 2;
189

1910
/**
2011
* redis-OK
@@ -61,4 +52,9 @@ public class Constant {
6152
*/
6253
public final static String CURRENT_TIME_MILLIS = "currentTimeMillis";
6354

55+
/**
56+
* PASSWORD_MAX_LEN
57+
*/
58+
public static final Integer PASSWORD_MAX_LEN = 8;
59+
6460
}

src/main/java/com/wang/util/JwtUtil.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public class JwtUtil {
2626
* 过期时间改为从配置文件获取
2727
*/
2828
private static String accessTokenExpireTime;
29-
// private static final long EXPIRE_TIME = 5 * 60 * 1000;
3029

3130
/**
3231
* JWT认证加密私钥(Base64加密)

src/main/resources/application.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ spring:
2525
maxOpenPreparedStatements: 20
2626

2727
mybatis:
28-
config-location: classpath:mybatis-config.xml
2928
mapper-locations: classpath:mapper/*.xml
3029
type-aliases-package: com.wang.model.entity
3130

@@ -37,9 +36,6 @@ pagehelper:
3736

3837
mapper:
3938
not-empty: true
40-
# mappers:
41-
# - tk.mybatis.mapper.common.Mapper
42-
# - tk.mybatis.mapper.common.Mapper2
4339

4440
logging:
4541
level.com.wang.mapper: debug

src/main/resources/mybatis-config.xml

Lines changed: 0 additions & 43 deletions
This file was deleted.

src/main/resources/sql/MySQL.sql

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,13 @@ reg_time datetime not null COMMENT "注册时间"
1515
CREATE TABLE role (
1616
id int primary key auto_increment COMMENT "ID",
1717
name varchar(128) not null unique COMMENT "角色名称"
18-
/*available int COMMENT '是否可用 1-可用 0-不可用'*/
1918
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT "角色表";
2019

2120

2221
CREATE TABLE permission (
2322
id int primary key auto_increment COMMENT "ID",
2423
name varchar(128) COMMENT '资源名称',
25-
/*type varchar(32) COMMENT '资源类型:menu,permission,button',
26-
url varchar(128) COMMENT '访问url地址',*/
2724
per_code varchar(128) not null unique COMMENT '权限代码字符串'
28-
/*available int COMMENT '是否可用 1-可用 0-不可用'*/
2925
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT "资源表";
3026

3127
CREATE TABLE user_role (

0 commit comments

Comments
 (0)