Commit 28dcde56 by huangjinxin

fix:ak与token鉴权并行

1 parent 581d8865
...@@ -84,25 +84,23 @@ public class AuthFilter implements GlobalFilter, Ordered { ...@@ -84,25 +84,23 @@ public class AuthFilter implements GlobalFilter, Ordered {
} }
// ak登录处理 // ak登录处理
if (StringUtils.isEmpty(authToken)) { final String ak = getParams(exchange, "ak", headers);
final String ak = getParams(exchange, "ak", headers); if (log.isTraceEnabled()) {
if (log.isTraceEnabled()) { log.trace("ak is {}", ak);
log.trace("ak is {}", ak); }
}
if (StringUtils.isNotEmpty(ak)) { if (StringUtils.isNotEmpty(ak)) {
// 验证ak,设置userDTO // 验证ak,设置userDTO
// 验证成功,设置为管理员 // 验证成功,设置为管理员
// AppDTO appDTO = gson.fromJson(value, AppDTO.class); // AppDTO appDTO = gson.fromJson(value, AppDTO.class);
// String secret = appDTO.getSecret(); // String secret = appDTO.getSecret();
Optional<Boolean> aBoolean = appKey(ak); Optional<Boolean> aBoolean = appKey(ak);
if (aBoolean.isPresent() && Objects.equals(Boolean.TRUE, aBoolean.get())) { if (aBoolean.isPresent() && Objects.equals(Boolean.TRUE, aBoolean.get())) {
final String sign = getParams(exchange, "sign", headers); final String sign = getParams(exchange, "sign", headers);
//计算签名 //计算签名
//TODO 参数签名校验 //TODO 参数签名校验
userDTO = new UserLoginDTO(); userDTO = new UserLoginDTO();
userDTO.setId(Globals.SUPER_ADMIN_ID); userDTO.setId(Globals.SUPER_ADMIN_ID);
}
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!