|
@@ -150,7 +150,7 @@ public class JySceneUserAuthServiceImpl extends ServiceImpl<IJySceneUserAuthMapp
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public void addAuth(JySceneUserAuth param) {
|
|
|
|
|
|
+ public synchronized void addAuth(JySceneUserAuth param) {
|
|
if(StringUtils.isBlank(param.getNum()) ){
|
|
if(StringUtils.isBlank(param.getNum()) ){
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
}
|
|
}
|
|
@@ -160,7 +160,6 @@ public class JySceneUserAuthServiceImpl extends ServiceImpl<IJySceneUserAuthMapp
|
|
throw new BusinessException(ResultCode.SCENE_NOT_EXITS);
|
|
throw new BusinessException(ResultCode.SCENE_NOT_EXITS);
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
if(StringUtils.isBlank(param.getRyId()) ){
|
|
if(StringUtils.isBlank(param.getRyId()) ){
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
}
|
|
}
|
|
@@ -273,10 +272,18 @@ public class JySceneUserAuthServiceImpl extends ServiceImpl<IJySceneUserAuthMapp
|
|
if(pro == null && plus == null){
|
|
if(pro == null && plus == null){
|
|
throw new BusinessException(ResultCode.SCENE_NOT_EXITS);
|
|
throw new BusinessException(ResultCode.SCENE_NOT_EXITS);
|
|
}
|
|
}
|
|
|
|
+ SceneAuthVo sceneAuthVo = new SceneAuthVo();
|
|
|
|
+
|
|
|
|
+ JySceneAuth jySceneAuth = jySceneAuthService.getByNum(num);
|
|
|
|
+ if(jySceneAuth!=null && jySceneAuth.getAuthType() == 1){
|
|
|
|
+ sceneAuthVo.setViewAuth(true);
|
|
|
|
+ }
|
|
|
|
+
|
|
String redisKey = String.format(RedisKeyUtil.loginToken,token);
|
|
String redisKey = String.format(RedisKeyUtil.loginToken,token);
|
|
if(!redisUtil.hasKey(redisKey)){
|
|
if(!redisUtil.hasKey(redisKey)){
|
|
- throw new BusinessException(ResultCode.USER_NOT_LOGIN);
|
|
|
|
|
|
+ return sceneAuthVo;
|
|
}
|
|
}
|
|
|
|
+
|
|
String userStr = redisUtil.get(redisKey);
|
|
String userStr = redisUtil.get(redisKey);
|
|
ManageLoginResponse result = JSONObject.parseObject(userStr,ManageLoginResponse.class);
|
|
ManageLoginResponse result = JSONObject.parseObject(userStr,ManageLoginResponse.class);
|
|
Long userId = result.getUserId();
|
|
Long userId = result.getUserId();
|
|
@@ -284,12 +291,6 @@ public class JySceneUserAuthServiceImpl extends ServiceImpl<IJySceneUserAuthMapp
|
|
redisUtil.del(redisKey);
|
|
redisUtil.del(redisKey);
|
|
throw new BusinessException(ResultCode.USER_NOT_LOGIN);
|
|
throw new BusinessException(ResultCode.USER_NOT_LOGIN);
|
|
}
|
|
}
|
|
- SceneAuthVo sceneAuthVo = new SceneAuthVo();
|
|
|
|
-
|
|
|
|
- JySceneAuth jySceneAuth = jySceneAuthService.getByNum(num);
|
|
|
|
- if(jySceneAuth!=null && jySceneAuth.getAuthType() == 1){
|
|
|
|
- sceneAuthVo.setViewAuth(true);
|
|
|
|
- }
|
|
|
|
|
|
|
|
SysUser byId = sysUserService.getById(result.getId());
|
|
SysUser byId = sysUserService.getById(result.getId());
|
|
JyUser jyUser = jyUserService.getBySysId(byId.getId());
|
|
JyUser jyUser = jyUserService.getBySysId(byId.getId());
|