mirror of https://github.com/elunez/eladmin
Merge branch 'master' of github.com:elunez/eladmin
commit
2380ed792d
|
@ -1,5 +1,6 @@
|
||||||
package me.zhengjie.modules.security.security;
|
package me.zhengjie.modules.security.security;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import io.jsonwebtoken.*;
|
import io.jsonwebtoken.*;
|
||||||
import io.jsonwebtoken.io.Decoders;
|
import io.jsonwebtoken.io.Decoders;
|
||||||
import io.jsonwebtoken.security.Keys;
|
import io.jsonwebtoken.security.Keys;
|
||||||
|
@ -16,6 +17,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||||
import java.security.Key;
|
import java.security.Key;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@ -63,10 +65,13 @@ public class TokenProvider implements InitializingBean {
|
||||||
.parseClaimsJws(token)
|
.parseClaimsJws(token)
|
||||||
.getBody();
|
.getBody();
|
||||||
|
|
||||||
|
// fix bug: 当前用户如果没有任何权限时,在输入用户名后,刷新验证码会抛IllegalArgumentException
|
||||||
|
Object authoritiesStr = claims.get(AUTHORITIES_KEY);
|
||||||
Collection<? extends GrantedAuthority> authorities =
|
Collection<? extends GrantedAuthority> authorities =
|
||||||
Arrays.stream(claims.get(AUTHORITIES_KEY).toString().split(","))
|
ObjectUtil.isNotEmpty(authoritiesStr) ?
|
||||||
|
Arrays.stream(authoritiesStr.toString().split(","))
|
||||||
.map(SimpleGrantedAuthority::new)
|
.map(SimpleGrantedAuthority::new)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList()) : Collections.emptyList();
|
||||||
|
|
||||||
User principal = new User(claims.getSubject(), "", authorities);
|
User principal = new User(claims.getSubject(), "", authorities);
|
||||||
|
|
||||||
|
|
|
@ -130,7 +130,7 @@ public class ${className}ServiceImpl implements ${className}Service {
|
||||||
@Override
|
@Override
|
||||||
//@CacheEvict(allEntries = true)
|
//@CacheEvict(allEntries = true)
|
||||||
public void deleteAll(${pkColumnType}[] ids) {
|
public void deleteAll(${pkColumnType}[] ids) {
|
||||||
for (${pkColumnType} id : ids) {
|
for (${pkColumnType} ${pkChangeColName} : ids) {
|
||||||
${changeClassName}Repository.deleteById(${pkChangeColName});
|
${changeClassName}Repository.deleteById(${pkChangeColName});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -153,4 +153,4 @@ public class ${className}ServiceImpl implements ${className}Service {
|
||||||
}
|
}
|
||||||
FileUtil.downloadExcel(list, response);
|
FileUtil.downloadExcel(list, response);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -593,7 +593,7 @@ CREATE TABLE `quartz_log` (
|
||||||
`params` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
|
`params` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
|
||||||
`time` bigint(20) NULL DEFAULT NULL,
|
`time` bigint(20) NULL DEFAULT NULL,
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE = InnoDB AUTO_INCREMENT = 288 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '定时任务日志' ROW_FORMAT = Compact;
|
) ENGINE = MyISAM AUTO_INCREMENT = 288 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '定时任务日志' ROW_FORMAT = Compact;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Table structure for role
|
-- Table structure for role
|
||||||
|
|
Loading…
Reference in New Issue