소스 검색

互联网医院

Trick 5 년 전
부모
커밋
999b93ea46
1개의 변경된 파일9개의 추가작업 그리고 7개의 파일을 삭제
  1. 9 7
      server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java

+ 9 - 7
server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java

@ -608,14 +608,16 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
    @RequestMapping(value = "/oauth/getHwlyyPublicKey", method = RequestMethod.GET)
    public ObjEnvelop getHwlyyPublicKey(){
//        KeyPair keyPair = com.yihu.jw.security.utils.RSAUtils.getKey();
//        byte[] bytekey = SerializeUtil.ObjTOSerialize(keyPair);
//        KeyPair key = (KeyPair)SerializeUtil.unSerialize(bytekey);
//        OauthKeypairDO keypairDO = new OauthKeypairDO();
//        keypairDO.setCode("hwlyyKey");
//        keypairDO.setKeyPair(bytekey);
//        oauthKeypairDao.save(keypairDO);
        OauthKeypairDO keypairDO = oauthKeypairDao.findByCode("hwlyyKey");
        if(keypairDO==null){
            KeyPair keyPair = com.yihu.jw.security.utils.RSAUtils.getKey();
            byte[] bytekey = SerializeUtil.ObjTOSerialize(keyPair);
            OauthKeypairDO kpDO = new OauthKeypairDO();
            kpDO.setCode("hwlyyKey");
            kpDO.setKeyPair(bytekey);
            keypairDO = oauthKeypairDao.save(kpDO);
        }
        KeyPair key = (KeyPair)SerializeUtil.unSerialize(keypairDO.getKeyPair());
        PublickeyVO pk = new PublickeyVO();
        pk.setPublicKey(com.yihu.jw.security.utils.RSAUtils.generateBase64PublicKey(key));