Commit 6f69aab4 authored by 周健威's avatar 周健威

修改代码

parent 34b0b089
......@@ -12,6 +12,24 @@
<artifactId>ace-auth-server</artifactId>
<dependencies>
<!-- maxkey -->
<dependency>
<groupId>maxkey</groupId>
<artifactId>maxkey-client-sdk</artifactId>
<version>3.0.0.RELEASE</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
<version>8.10</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>maxkey</groupId>-->
<!-- <artifactId>maxkey-client-sdk</artifactId>-->
<!-- <version>0.0.1</version>-->
<!-- </dependency>-->
<!-- swagger -->
<dependency>
<groupId>com.spring4all</groupId>
......
package com.github.wxiaoqi.security.auth.controller;
import com.alibaba.fastjson.JSONObject;
import com.connsec.client.utils.PathUtils;
import com.github.wxiaoqi.security.auth.service.AuthService;
import com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationRequest;
import com.github.wxiaoqi.security.common.constant.RequestTypeConstants;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.util.result.JsonResultUtil;
import com.nimbusds.jose.crypto.RSASSAVerifier;
import com.nimbusds.jose.jwk.JWKSet;
import com.nimbusds.jwt.JWTClaimsSet;
import com.nimbusds.jwt.SignedJWT;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
//import org.maxkey.client.utils.PathUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.security.interfaces.RSAKey;
import java.util.Map;
@Api(tags = "用户登录")
......@@ -52,6 +60,34 @@ public class AuthController {
return new ObjectRestResponse<String>().data(token);
}
// @RequestMapping(value = "tokenMaxkey", method = RequestMethod.POST)
// public ObjectRestResponse<String> createAuthenticationTokenMaxkey(
// @RequestBody JwtAuthenticationRequest authenticationRequest,
// HttpServletRequest request) throws Exception {
// String path = request.getContextPath();
// String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
// String token=request.getParameter("jwt");
// System.out.println("jwt "+token);
// SignedJWT signedJWT=null;
//
// //JWKSetKeyStore jwkSetKeyStore=new JWKSetKeyStore();
//
// File jwksFile=new File(PathUtils.getInstance().getClassPath()+"jwk.jwks");
// JWKSet jwkSet= JWKSet.load(jwksFile);
//
// RSASSAVerifier rsaSSAVerifier = new RSASSAVerifier(((RSAKey) jwkSet.getKeyByKeyId("maxkey_rsa")).toRSAPublicKey());
// try {
//
// signedJWT = SignedJWT.parse(token);
// } catch (java.text.ParseException e) {
// // Invalid signed JWT encoding
// }
//
// System.out.println("signedJWT "+signedJWT);
// JWTClaimsSet jwtClaims =signedJWT.getJWTClaimsSet();
// return new ObjectRestResponse<String>().data("");
// }
@RequestMapping(value = "token/small", method = RequestMethod.POST)
public ObjectRestResponse<String> createAuthenticationTokenSmall(
@RequestBody JwtAuthenticationRequest authenticationRequest,
......
......@@ -30,6 +30,7 @@ import org.springframework.web.bind.annotation.*;
import tk.mybatis.mapper.entity.Example;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
......@@ -210,7 +211,7 @@ public class AdminGaindataController extends BaseController<GainDataBiz, GainDat
baseBiz.handleDataNum(dataMenuMap, dataMenuMap.get(gainDataVO.getMenuId()));
}
}
List<GainDataBiz.DataMenuStats> dataMenuStats = (List)dataMenuMap.values();
List<GainDataBiz.DataMenuStats> dataMenuStats = CollUtil.newArrayList(dataMenuMap.values());
return ObjectRestResponse.succ(dataMenuBiz.getImageMenuStatsTree(dataMenuStats, AdminCommonConstant.ROOT));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment