From e0be0c7b977895f7ffdec3302ab9a299d17e7c81 Mon Sep 17 00:00:00 2001 From: 101captain <237651143@qq.com> Date: 星期四, 16 九月 2021 09:44:55 +0800 Subject: [PATCH] 一键报警相关功能修改 --- springcloud_k8s_panzhihuazhihuishequ/auth/src/main/java/com/panzhihua/auth/service/impl/LoginServiceImpl.java | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 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 64d49df..5035e57 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 @@ -4,6 +4,7 @@ import javax.annotation.Resource; +import com.panzhihua.common.model.vos.R; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.ValueOperations; @@ -208,4 +209,34 @@ return loginReturnVO; } + @Override + public LoginReturnVO loginCgBackage(String account, String password){ + Authentication authentication = null; + authentication = + authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(account + "_8", 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; + } + + @Override + public LoginReturnsVO loginAlarmApp(String account, String password) { + Authentication authentication = null; + authentication = + authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(account + "_9", password)); + LoginUserInfoVO loginUser = (LoginUserInfoVO)authentication.getPrincipal(); + String token = JWTTokenUtil.generateToken(loginUser); + String refeshToken = JWTTokenUtil.generateRefeshToken(loginUser); + LoginReturnsVO loginReturnVO = new LoginReturnsVO(); + loginReturnVO.setToken(token); + loginReturnVO.setRefreshToken(refeshToken); + loginReturnVO.setUserId(loginUser.getUserId()); + loginReturnVO.setCommunityId(loginUser.getCommunityId()); + return loginReturnVO; + } + } -- Gitblit v1.7.1