Commit 69da943c authored by wzp's avatar wzp

修改bug

parent a5ddfc3e
...@@ -110,7 +110,7 @@ public class ChinaMobileRestApiController extends BaseController { ...@@ -110,7 +110,7 @@ public class ChinaMobileRestApiController extends BaseController {
@Resource @Resource
private TAppRunPicService appRunPicService; private TAppRunPicService appRunPicService;
private static final String SHIRO_JWT_TOKEN = "shiro:jwt:token:"; private static final String SHIRO_JWT_TOKEN = "shiro:jwt:macToken:";
//用户登录次数计数 redisKey 前缀 //用户登录次数计数 redisKey 前缀
private static final String SHIRO_LOGIN_COUNT = "shiro_login_count_"; private static final String SHIRO_LOGIN_COUNT = "shiro_login_count_";
//用户登录是否被锁定 一小时 redisKey 前缀 //用户登录是否被锁定 一小时 redisKey 前缀
......
...@@ -21,13 +21,11 @@ import org.apache.commons.lang3.StringUtils; ...@@ -21,13 +21,11 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.*;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/** /**
* <pre> * <pre>
...@@ -52,6 +50,8 @@ public class TBoxOperationController extends BaseController { ...@@ -52,6 +50,8 @@ public class TBoxOperationController extends BaseController {
@Resource @Resource
private StringRedisTemplate stringRedisTemplate; private StringRedisTemplate stringRedisTemplate;
private static final String SHIRO_JWT_MACTOKEN = "shiro:jwt:macToken:";
@ApiImplicitParams(value = { @ApiImplicitParams(value = {
@ApiImplicitParam(name = "_index", value = "分页起始偏移量", paramType = "query", dataType = "Integer"), @ApiImplicitParam(name = "_index", value = "分页起始偏移量", paramType = "query", dataType = "Integer"),
@ApiImplicitParam(name = "_size", value = "返回条数", paramType = "query", dataType = "Integer"), @ApiImplicitParam(name = "_size", value = "返回条数", paramType = "query", dataType = "Integer"),
...@@ -145,6 +145,14 @@ public class TBoxOperationController extends BaseController { ...@@ -145,6 +145,14 @@ public class TBoxOperationController extends BaseController {
} }
if (3==tBoxOperation.getStatus()) { if (3==tBoxOperation.getStatus()) {
tBoxOperation.setMac(""); tBoxOperation.setMac("");
TUser u = userService.getOne(new UpdateWrapper<TUser>().eq("org_id",tBoxOperation.getOrganId()).eq("type", 3).eq("is_deleted", false));
Set<String> keys = stringRedisTemplate.keys(SHIRO_JWT_MACTOKEN + "*");
ValueOperations<String, String> value = stringRedisTemplate.opsForValue();
for (String key : keys) {
if (u.getId().equals(value.get(key))){
stringRedisTemplate.delete(key);
}
}
} }
boolean flag = tBoxOperationService.updateById(tBoxOperation); boolean flag = tBoxOperationService.updateById(tBoxOperation);
UpdateWrapper<TUser> wrapper = new UpdateWrapper<>(); UpdateWrapper<TUser> wrapper = new UpdateWrapper<>();
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, user_name, password_hash, password_salt, create_time, update_time, org_id, permanent, effective_date, exired_date, status, phone, email, we_chat, telephone, is_deleted, real_name,type u.id, u.user_name, u.password_hash, u.password_salt, u.create_time, u.update_time, u.org_id, u.permanent, u.effective_date, u.exired_date, u.status, u.phone, u.email, u.we_chat, u.telephone, u.is_deleted, u.real_name,u.type,u.audit_status,u.area_id
</sql> </sql>
<select id="selectByUsername" resultMap="BaseResultMap"> <select id="selectByUsername" resultMap="BaseResultMap">
...@@ -53,7 +53,8 @@ ...@@ -53,7 +53,8 @@
</select> </select>
<select id="getById" resultMap="BaseResultMap"> <select id="getById" resultMap="BaseResultMap">
select u.*,o.name org_name,a.full_name area_name select u.id, u.user_name,u.create_time, u.update_time, u.org_id, u.permanent, u.effective_date, u.exired_date, u.status, u.phone, u.email, u.we_chat, u.telephone, u.is_deleted, u.real_name,u.type,u.audit_status,u.area_id
,o.name org_name,a.full_name area_name
from t_user u from t_user u
left join t_organ o on o.id = u.org_id left join t_organ o on o.id = u.org_id
left join t_area a on u.area_id = a.id left join t_area a on u.area_id = a.id
...@@ -61,7 +62,8 @@ ...@@ -61,7 +62,8 @@
</select> </select>
<select id="getList" resultMap="BaseResultMap"> <select id="getList" resultMap="BaseResultMap">
select u.*,o.name org_name,a.full_name area_name select u.id, u.user_name,u.create_time, u.update_time, u.org_id, u.permanent, u.effective_date, u.exired_date, u.status, u.phone, u.email, u.we_chat, u.telephone, u.is_deleted, u.real_name,u.type,u.audit_status,u.area_id
,o.name org_name,a.full_name area_name
from t_user u from t_user u
left join t_organ o on o.id = u.org_id left join t_organ o on o.id = u.org_id
left join t_area a on u.area_id = a.id left join t_area a on u.area_id = a.id
...@@ -96,7 +98,8 @@ ...@@ -96,7 +98,8 @@
<select id="getUserList" resultMap="BaseResultMap"> <select id="getUserList" resultMap="BaseResultMap">
select u.*,o.name org_name,a.full_name area_name select u.id, u.user_name, u.create_time, u.update_time, u.org_id, u.permanent, u.effective_date, u.exired_date, u.status, u.phone, u.email, u.we_chat, u.telephone, u.is_deleted, u.real_name,u.type,u.audit_status,u.area_id
,o.name org_name,a.full_name area_name
from t_user u from t_user u
left join t_organ o on o.id = u.org_id left join t_organ o on o.id = u.org_id
left join t_area a on u.area_id = a.id left join t_area a on u.area_id = a.id
......
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