From c87e44fb1a97619711d84eecba0136f1ec88b95c Mon Sep 17 00:00:00 2001 From: 张天森 <1292933220@qq.com> Date: 星期四, 29 九月 2022 10:27:06 +0800 Subject: [PATCH] update --- springcloud_k8s_panzhihuazhihuishequ/auth/src/main/java/com/panzhihua/auth/service/impl/LoginServiceImpl.java | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/auth/src/main/java/com/panzhihua/auth/service/impl/LoginServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/auth/src/main/java/com/panzhihua/auth/service/impl/LoginServiceImpl.java index 28ea6fe..0879cd3 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/auth/src/main/java/com/panzhihua/auth/service/impl/LoginServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/auth/src/main/java/com/panzhihua/auth/service/impl/LoginServiceImpl.java @@ -300,4 +300,16 @@ loginReturnVO.setRefreshToken(refeshToken); return loginReturnVO; } + + @Override + public LoginReturnVO tfLogin(String account, String password, String appid) { + Authentication authentication = authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(account + "_16"+"_"+appid, password)); + LoginUserInfoVO loginUser = (LoginUserInfoVO)authentication.getPrincipal(); + String token = JWTTokenUtil.generateToken(loginUser); + String refeshToken = JWTTokenUtil.generateRefeshToken(loginUser); + LoginReturnVO loginReturnVO = new LoginReturnVO(); + loginReturnVO.setToken(token); + loginReturnVO.setRefreshToken(refeshToken); + return loginReturnVO; + } } -- Gitblit v1.7.1