Commit 39e94380 authored by wzp's avatar wzp

修改bug

parent 115ec3c1
...@@ -23,6 +23,7 @@ import org.apache.commons.lang3.StringUtils; ...@@ -23,6 +23,7 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
...@@ -241,6 +242,28 @@ public class LoginController extends BaseController { ...@@ -241,6 +242,28 @@ public class LoginController extends BaseController {
return getFailResult("注销错误"); return getFailResult("注销错误");
} }
@RequestMapping(value = "logoutUser", method = RequestMethod.GET)
public Map<String, Object> logoutUser(String id) {
try {
Set<String> keys = stringRedisTemplate.keys(SHIRO_JWT_TOKEN + "*");
ValueOperations<String, String> value = stringRedisTemplate.opsForValue();
for (String key : keys) {
if (id.equals(value.get(key))){
stringRedisTemplate.delete(key);
}
}
JSONObject resultMap = new JSONObject();
resultMap.put("resultCode", "200");
resultMap.put("message", "成功");
resultMap.put("data", "");
return resultMap;
} catch (Exception e) {
LOGGER.error("注销错误", e);
}
return getFailResult("注销错误");
}
@RequestMapping(value = {"/verifyCode"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/verifyCode"}, method = {RequestMethod.GET})
public void verifyCode(HttpServletResponse response, Integer width, Integer height) { public void verifyCode(HttpServletResponse response, Integer width, Integer height) {
String uuid = UUID.randomUUID().toString(); String uuid = UUID.randomUUID().toString();
......
...@@ -167,6 +167,14 @@ public class TOrganController extends BaseController { ...@@ -167,6 +167,14 @@ public class TOrganController extends BaseController {
public Map<String, Object> deleteTOrgan(String id) { public Map<String, Object> deleteTOrgan(String id) {
boolean result; boolean result;
try { try {
List<TUser> list = userService.list(new UpdateWrapper<TUser>().eq("org_id", id).eq("is_deleted", "0"));
if (list!=null&&list.size()>0&&list.get(0)!=null){
HashMap<String, Object> map = new HashMap<>();
map.put("resultCode","500");
map.put("message","机构下存在用户,不可以删除!");
map.put("data","");
return map;
}
TOrgan tOrgan = tOrganService.getById(id); TOrgan tOrgan = tOrganService.getById(id);
tOrgan.setIsDeleted(true); tOrgan.setIsDeleted(true);
tOrgan.setUpdateTime(DateUtil80.getDateTimeOfTimestamp(System.currentTimeMillis())); tOrgan.setUpdateTime(DateUtil80.getDateTimeOfTimestamp(System.currentTimeMillis()));
......
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