From e4c05d381d2dadf129b3a4cb499c8ea67e7fc481 Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Mon, 08 Nov 2021 17:19:47 +0800
Subject: [PATCH] fix
---
zq-erp/src/main/java/com/matrix/system/app/action/ApiUsersAction.java | 29 ++++++++++++++---------------
1 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/zq-erp/src/main/java/com/matrix/system/app/action/ApiUsersAction.java b/zq-erp/src/main/java/com/matrix/system/app/action/ApiUsersAction.java
index 7d83f3b..e4fdf69 100644
--- a/zq-erp/src/main/java/com/matrix/system/app/action/ApiUsersAction.java
+++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiUsersAction.java
@@ -1,23 +1,25 @@
package com.matrix.system.app.action;
-import com.matrix.component.redis.RedisClient;
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.tools.DateUtil;
import com.matrix.core.tools.WebUtil;
-import com.matrix.system.app.dto.*;
-import com.matrix.system.app.mapper.SysBeauticianStateMapper;
+import com.matrix.system.app.dto.BeauticianDto;
+import com.matrix.system.app.dto.ModifyUserDto;
+import com.matrix.system.app.dto.PwdModifyDto;
+import com.matrix.system.app.dto.UsersQueryDto;
import com.matrix.system.app.mapper.SysUsersMapper;
import com.matrix.system.app.mapper.SysWorkBeatuistaffMapper;
import com.matrix.system.app.vo.BeauticianVo;
import com.matrix.system.app.vo.UserAchieveVo;
import com.matrix.system.app.vo.UserInfoDetailVo;
import com.matrix.system.common.bean.SysUsers;
+import com.matrix.system.common.init.LocalCache;
+import com.matrix.system.common.interceptor.ApiUserLoginInterceptor;
import com.matrix.system.common.service.SysUsersService;
import com.matrix.system.common.tools.DataAuthUtil;
import com.matrix.system.common.tools.PasswordUtil;
import com.matrix.system.hive.action.BaseController;
-import com.matrix.system.hive.bean.SysBeauticianState;
import com.matrix.system.hive.bean.SysWorkBeatuistaff;
import com.matrix.system.hive.service.AchieveNewService;
import com.matrix.system.hive.service.SysWorkBeatuistaffService;
@@ -27,13 +29,13 @@
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
-import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
import java.io.UnsupportedEncodingException;
import java.security.NoSuchAlgorithmException;
-import java.util.ArrayList;
import java.util.List;
/**
@@ -57,9 +59,8 @@
@Autowired
private SysWorkBeatuistaffService sysWorkBeatuistaffService;
- @Autowired
- private RedisClient redisClient;
-
+ @Value("${login_private_key}")
+ private String privateKey;
@ApiOperation(value = "个人中心--获取用户业绩接口 type 1-今日 2-昨天 3-本月 4-上月")
@ApiResponses({
@@ -101,12 +102,9 @@
@ApiOperation(value = "退出登陆", notes = "退出登陆")
@GetMapping(value = "/loginOut")
- public AjaxResult loginOut() {
- SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
- String token = redisClient.getCachedValue(sysUsers.getSuId().toString());
-
- redisClient.removeObject(token);
- redisClient.removeObject(sysUsers.getSuId().toString());
+ public AjaxResult loginOut(HttpServletRequest request) {
+ String token=ApiUserLoginInterceptor.resolveToken(request,privateKey);
+ LocalCache.remove(token);
return AjaxResult.buildSuccessInstance("退出成功");
}
@@ -125,6 +123,7 @@
query.setCompanyId(sysUsers.getCompanyId());
query.setShopId(sysUsers.getShopId());
}
+ query.setSuUserType("employee");
query.setSuName(usersQueryDto.getQueryKey());
List<SysUsers> list = sysUsersService.findByModel(query);
List<BeauticianVo> dataList = SysUsersMapper.INSTANCE.usersListToBeautyList(list);
--
Gitblit v1.9.1