Skip to content

Commit

Permalink
按照Alibaba Java Coding Guidelines插件扫描结果,修改代码规范,删除无用注释
Browse files Browse the repository at this point in the history
  • Loading branch information
dolyw committed Nov 13, 2018
1 parent d00eb23 commit ac4c980
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 64 deletions.
1 change: 0 additions & 1 deletion src/main/java/com/wang/config/shiro/jwt/JwtFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ protected boolean isAccessAllowed(ServletRequest request, ServletResponse respon
Throwable throwable = e.getCause();
if(throwable != null && throwable instanceof SignatureVerificationException ){
// 该异常为JWT的AccessToken认证失败(Token或者密钥不正确)
// throw (SignatureVerificationException) throwable;
msg = "Token或者密钥不正确(" + throwable.getMessage() + ")";
} else if(throwable != null && throwable instanceof TokenExpiredException){
// 该异常为JWT的AccessToken已过期,判断RefreshToken未过期就进行AccessToken刷新
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/wang/controller/UserController.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public ResponseBean add(@Validated(UserEditValidGroup.class) @RequestBody UserDt
}
userDto.setRegTime(new Date());
// 密码以帐号+密码的形式进行AES加密
if(userDto.getPassword().length() > 8){
if(userDto.getPassword().length() > Constant.PASSWORD_MAX_LEN){
throw new CustomException("密码最多8位(Password up to 8 bits.)");
}
String key = AesCipherUtil.enCrypto(userDto.getAccount() + userDto.getPassword());
Expand Down Expand Up @@ -244,7 +244,7 @@ public ResponseBean update(@Validated(UserEditValidGroup.class) @RequestBody Use
// FIXME: 如果不一样就说明用户修改了密码,重新加密密码(这个处理不太好,但是没有想到好的处理方式)
if(!userDtoTemp.getPassword().equals(userDto.getPassword())){
// 密码以帐号+密码的形式进行AES加密
if(userDto.getPassword().length() > 8){
if(userDto.getPassword().length() > Constant.PASSWORD_MAX_LEN){
throw new CustomException("密码最多8位(Password up to 8 bits.)");
}
String key = AesCipherUtil.enCrypto(userDto.getAccount() + userDto.getPassword());
Expand Down
14 changes: 5 additions & 9 deletions src/main/java/com/wang/model/common/Constant.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@
* @date 2018/9/3 16:03
*/
public class Constant {
/**
* 1
*/
public static final Integer INTEGER_1 = 1;

/**
* 2
*/
public static final Integer INTEGER_2 = 2;

/**
* redis-OK
Expand Down Expand Up @@ -61,4 +52,9 @@ public class Constant {
*/
public final static String CURRENT_TIME_MILLIS = "currentTimeMillis";

/**
* PASSWORD_MAX_LEN
*/
public static final Integer PASSWORD_MAX_LEN = 8;

}
1 change: 0 additions & 1 deletion src/main/java/com/wang/util/JwtUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public class JwtUtil {
* 过期时间改为从配置文件获取
*/
private static String accessTokenExpireTime;
// private static final long EXPIRE_TIME = 5 * 60 * 1000;

/**
* JWT认证加密私钥(Base64加密)
Expand Down
4 changes: 0 additions & 4 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ spring:
maxOpenPreparedStatements: 20

mybatis:
config-location: classpath:mybatis-config.xml
mapper-locations: classpath:mapper/*.xml
type-aliases-package: com.wang.model.entity

Expand All @@ -37,9 +36,6 @@ pagehelper:

mapper:
not-empty: true
# mappers:
# - tk.mybatis.mapper.common.Mapper
# - tk.mybatis.mapper.common.Mapper2

logging:
level.com.wang.mapper: debug
43 changes: 0 additions & 43 deletions src/main/resources/mybatis-config.xml

This file was deleted.

4 changes: 0 additions & 4 deletions src/main/resources/sql/MySQL.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,13 @@ reg_time datetime not null COMMENT "注册时间"
CREATE TABLE role (
id int primary key auto_increment COMMENT "ID",
name varchar(128) not null unique COMMENT "角色名称"
/*available int COMMENT '是否可用 1-可用 0-不可用'*/
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT "角色表";


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

CREATE TABLE user_role (
Expand Down

0 comments on commit ac4c980

Please sign in to comment.