Quellcode durchsuchen

Merge branch 'dev' of trick9191/wlyy2.0 into dev

trick9191 vor 5 Jahren
Ursprung
Commit
71f92893c7

+ 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));