|
@@ -80,7 +80,7 @@ public class LoginService {
|
|
if(!user.getPassword().equals(passwordCode)){
|
|
if(!user.getPassword().equals(passwordCode)){
|
|
throw new BusinessException(LoginConstant.FAILURE_CODE_3014, LoginConstant.FAILURE_MSG_3014);
|
|
throw new BusinessException(LoginConstant.FAILURE_CODE_3014, LoginConstant.FAILURE_MSG_3014);
|
|
}
|
|
}
|
|
- String token = this.redisLogin(user.getUserName(),JSONObject.toJSONString(user));
|
|
|
|
|
|
+ String token = this.redisLogin(user.getUserName(),JSONObject.toJSONString(user),"user");
|
|
loginLogService.addLog("",token);
|
|
loginLogService.addLog("",token);
|
|
UserVo userVo = new UserVo();
|
|
UserVo userVo = new UserVo();
|
|
BeanUtils.copyProperties(user,userVo);
|
|
BeanUtils.copyProperties(user,userVo);
|
|
@@ -218,7 +218,7 @@ public class LoginService {
|
|
userVo.setId(cameraDetail.getUserId());
|
|
userVo.setId(cameraDetail.getUserId());
|
|
userVo.setCameraId(camera.getId());
|
|
userVo.setCameraId(camera.getId());
|
|
userVo.setCameraLogin(1);
|
|
userVo.setCameraLogin(1);
|
|
- String token = this.redisLogin(childName,JSONObject.toJSONString(userVo));
|
|
|
|
|
|
+ String token = this.redisLogin(childName,JSONObject.toJSONString(userVo),"camera");
|
|
JSONObject obj = new JSONObject();
|
|
JSONObject obj = new JSONObject();
|
|
obj.put("token",token);
|
|
obj.put("token",token);
|
|
obj.put("childName",childName);
|
|
obj.put("childName",childName);
|
|
@@ -283,8 +283,8 @@ public class LoginService {
|
|
userService.updatePassword(param.getPhoneNum(), pwdMd5);
|
|
userService.updatePassword(param.getPhoneNum(), pwdMd5);
|
|
}
|
|
}
|
|
|
|
|
|
- public String redisLogin(String userName,String value){
|
|
|
|
- String token = JwtUtil.createJWT(-1,userName,"user");
|
|
|
|
|
|
+ public String redisLogin(String userName,String value,String loginType){
|
|
|
|
+ String token = JwtUtil.createJWT(-1,userName,loginType);
|
|
String redisKey = String.format(RedisKey.TOKEN_V3,token);
|
|
String redisKey = String.format(RedisKey.TOKEN_V3,token);
|
|
redisUtil.set(redisKey, value,2 * 60 * 60);
|
|
redisUtil.set(redisKey, value,2 * 60 * 60);
|
|
return token;
|
|
return token;
|