Commit c3ecba23 authored by ma's avatar ma

删除用户后更新应用和设备缓存数据

parent dcda0114
......@@ -12,6 +12,8 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import iot.sixiang.license.auth.AuthManager;
import iot.sixiang.license.device.DeviceManager;
import iot.sixiang.license.entity.Permission;
import iot.sixiang.license.entity.User;
import iot.sixiang.license.entity.UserPermission;
......@@ -32,6 +34,7 @@ import iot.sixiang.license.util.EmailUtils;
import iot.sixiang.license.util.TreeUtil;
import iot.sixiang.license.xss.XssUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.DigestUtils;
import org.springframework.web.bind.WebDataBinder;
......@@ -66,6 +69,10 @@ public class UserController {
private ApplyService applyService;
@Resource
private DeviceService deviceService;
@Resource
private DeviceManager deviceManager;
@Resource
private AuthManager authManager;
@Value("${rsa.private_key}")
private String PRIVATE_KRY;
......@@ -152,6 +159,8 @@ public class UserController {
applyService.deleteByUserId(Integer.parseInt(userId));
boolean res = userService.deleteUser(Integer.parseInt(userId));
userPermissionService.deleteUserPermission(Integer.parseInt(userId));
deviceManager.initDevices();
authManager.initApps();
UserUtils.removeToken(userId);
UserUtils.removeTokenExp(userId);
if (res) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment