优化用户查询接口:先校验是否登录,然后才能查询用户数据

This commit is contained in:
jishenghua
2024-08-28 22:53:27 +08:00
parent ac33040c23
commit 6ab20c7baa
2 changed files with 36 additions and 27 deletions

View File

@@ -219,7 +219,7 @@ public class UserController {
public JSONArray getUserList(HttpServletRequest request)throws Exception {
JSONArray dataArray = new JSONArray();
try {
List<User> dataList = userService.getUser();
List<User> dataList = userService.getUser(request);
if (null != dataList) {
for (User user : dataList) {
JSONObject item = new JSONObject();
@@ -476,7 +476,7 @@ public class UserController {
Long userId = Long.parseLong(redisService.getObjectFromSessionByKey(request,"userId").toString());
User user = userService.getUser(userId);
//获取当前用户数
int userCurrentNum = userService.getUser().size();
int userCurrentNum = userService.getUser(request).size();
Tenant tenant = tenantService.getTenantByTenantId(user.getTenantId());
if(tenant.getExpireTime()!=null && tenant.getExpireTime().getTime()<System.currentTimeMillis()){
//租户已经过期移除token