master
邱飞云 4 years ago
parent 0494bd9234
commit bd0ed35c15
  1. 2
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java
  2. 7
      dq-framework-common/src/main/java/com/daqing/framework/util/Md5Util.java
  3. 5
      dq-govern-gateway/src/main/java/com/daqing/financial/gateway/config/ApiGlobalFilter.java

@ -142,7 +142,7 @@ public class UserLoginServiceImpl extends ServiceImpl<UserLoginDao, UserEntity>
Token userToken = tokenService.getOne(new QueryWrapper<Token>().eq("user_id", userEntity.getId())); Token userToken = tokenService.getOne(new QueryWrapper<Token>().eq("user_id", userEntity.getId()));
if(userToken != null){ if(userToken != null){
//删除redis里面的token //删除redis里面的token
JwtUtils.removeTokenByToken(userToken.getToken()); //JwtUtils.removeTokenByToken(userToken.getToken());
//数据库重置token //数据库重置token
userToken.setToken(token); userToken.setToken(token);
userToken.setCreateTime(new Date()); userToken.setCreateTime(new Date());

@ -4,7 +4,6 @@ package com.daqing.framework.util;
import org.springframework.util.DigestUtils; import org.springframework.util.DigestUtils;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
/** /**
* @author zcw * @author zcw
@ -22,8 +21,8 @@ public class Md5Util {
} }
public static void main(String[] args) throws UnsupportedEncodingException { public static void main(String[] args) throws UnsupportedEncodingException {
//System.out.printf(md5("1234561")); System.out.printf(md5("1234562"));
String s = URLEncoder.encode("www.occupationlab.com", "utf-8"); /*String s = URLEncoder.encode("www.occupationlab.com", "utf-8");
System.out.println(s); System.out.println(s);*/
} }
} }

@ -2,7 +2,6 @@ package com.daqing.financial.gateway.config;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.daqing.framework.util.JwtUtils; import com.daqing.framework.util.JwtUtils;
import com.daqing.framework.util.RedisUtil;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.gateway.filter.GatewayFilterChain; import org.springframework.cloud.gateway.filter.GatewayFilterChain;
@ -85,10 +84,10 @@ public class ApiGlobalFilter implements GlobalFilter, Ordered {
* @return userPhone * @return userPhone
*/ */
private Boolean verifyJWT(String token){ private Boolean verifyJWT(String token){
String id = RedisUtil.get("dq:token:"+token); /*String id = RedisUtil.get("dq:token:"+token);
if(id == null || "".equals(id)){ if(id == null || "".equals(id)){
return false; return false;
} }*/
return JwtUtils.validateJWT(token); return JwtUtils.validateJWT(token);
//return Long.parseLong(id); //return Long.parseLong(id);
} }

Loading…
Cancel
Save