From bd0ed35c154a72a7182082db50f0f9a3c626223f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E9=A3=9E=E4=BA=91?= <1941783199@qq.com> Date: Tue, 29 Sep 2020 17:59:41 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BC=98=E5=8C=96jwt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hrauth/service/impl/UserLoginServiceImpl.java | 2 +- .../src/main/java/com/daqing/framework/util/Md5Util.java | 7 +++---- .../daqing/financial/gateway/config/ApiGlobalFilter.java | 5 ++--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java index 0551e573..3e4e6d5b 100644 --- a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java +++ b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java @@ -142,7 +142,7 @@ public class UserLoginServiceImpl extends ServiceImpl Token userToken = tokenService.getOne(new QueryWrapper().eq("user_id", userEntity.getId())); if(userToken != null){ //删除redis里面的token - JwtUtils.removeTokenByToken(userToken.getToken()); + //JwtUtils.removeTokenByToken(userToken.getToken()); //数据库重置token userToken.setToken(token); userToken.setCreateTime(new Date()); diff --git a/dq-framework-common/src/main/java/com/daqing/framework/util/Md5Util.java b/dq-framework-common/src/main/java/com/daqing/framework/util/Md5Util.java index 870f5e5a..3b781e9c 100644 --- a/dq-framework-common/src/main/java/com/daqing/framework/util/Md5Util.java +++ b/dq-framework-common/src/main/java/com/daqing/framework/util/Md5Util.java @@ -4,7 +4,6 @@ package com.daqing.framework.util; import org.springframework.util.DigestUtils; import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; /** * @author zcw @@ -22,8 +21,8 @@ public class Md5Util { } public static void main(String[] args) throws UnsupportedEncodingException { - //System.out.printf(md5("1234561")); - String s = URLEncoder.encode("www.occupationlab.com", "utf-8"); - System.out.println(s); + System.out.printf(md5("1234562")); + /*String s = URLEncoder.encode("www.occupationlab.com", "utf-8"); + System.out.println(s);*/ } } diff --git a/dq-govern-gateway/src/main/java/com/daqing/financial/gateway/config/ApiGlobalFilter.java b/dq-govern-gateway/src/main/java/com/daqing/financial/gateway/config/ApiGlobalFilter.java index 1c03c1da..6a488534 100644 --- a/dq-govern-gateway/src/main/java/com/daqing/financial/gateway/config/ApiGlobalFilter.java +++ b/dq-govern-gateway/src/main/java/com/daqing/financial/gateway/config/ApiGlobalFilter.java @@ -2,7 +2,6 @@ package com.daqing.financial.gateway.config; import com.alibaba.fastjson.JSONObject; import com.daqing.framework.util.JwtUtils; -import com.daqing.framework.util.RedisUtil; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.cloud.gateway.filter.GatewayFilterChain; @@ -85,10 +84,10 @@ public class ApiGlobalFilter implements GlobalFilter, Ordered { * @return userPhone */ private Boolean verifyJWT(String token){ - String id = RedisUtil.get("dq:token:"+token); + /*String id = RedisUtil.get("dq:token:"+token); if(id == null || "".equals(id)){ return false; - } + }*/ return JwtUtils.validateJWT(token); //return Long.parseLong(id); } From c59f4eb66ca1594c579b0f015fd4bd85e5fec90c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E9=A3=9E=E4=BA=91?= <1941783199@qq.com> Date: Sat, 10 Oct 2020 09:53:29 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=AD=A3=E5=BC=8F?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/bootstrap.properties | 24 ++++++++++--- .../src/main/resources/bootstrap.properties | 23 +++++++++++- .../src/main/resources/bootstrap.properties | 35 +++++++++++++++++-- .../src/main/resources/bootstrap.properties | 23 +++++++++++- .../src/main/resources/bootstrap.properties | 15 +++++++- 5 files changed, 110 insertions(+), 10 deletions(-) diff --git a/dq-financial-crms-auth/src/main/resources/bootstrap.properties b/dq-financial-crms-auth/src/main/resources/bootstrap.properties index 160ddf8b..a490d22f 100644 --- a/dq-financial-crms-auth/src/main/resources/bootstrap.properties +++ b/dq-financial-crms-auth/src/main/resources/bootstrap.properties @@ -1,7 +1,5 @@ - -# +# 开发和测试环境(dev) spring.application.name=dq-financial-crms -#ĵַ spring.cloud.nacos.config.server-addr=192.168.31.142:8848 spring.cloud.nacos.config.namespace=37d72d30-3178-4173-8b5e-269a23355ed9 #spring.cloud.nacos.config.group=prod @@ -16,4 +14,22 @@ spring.cloud.nacos.config.ext-config[1].refresh=true spring.cloud.nacos.config.ext-config[2].data-id=other.yml spring.cloud.nacos.config.ext-config[2].group=dev -spring.cloud.nacos.config.ext-config[2].refresh=true \ No newline at end of file +spring.cloud.nacos.config.ext-config[2].refresh=true + +# 开发和测试环境(prod) +#spring.application.name=dq-financial-crms +#spring.cloud.nacos.config.server-addr=120.78.127.12:8848 +#spring.cloud.nacos.config.namespace=204f5ba8-12e0-46b3-b7ea-5c8e4a966640 +##spring.cloud.nacos.config.group=prod +# +#spring.cloud.nacos.config.ext-config[0].data-id=datasource.yml +#spring.cloud.nacos.config.ext-config[0].group=prod +#spring.cloud.nacos.config.ext-config[0].refresh=true +# +#spring.cloud.nacos.config.ext-config[1].data-id=mybatis.yml +#spring.cloud.nacos.config.ext-config[1].group=prod +#spring.cloud.nacos.config.ext-config[1].refresh=true +# +#spring.cloud.nacos.config.ext-config[2].data-id=other.yml +#spring.cloud.nacos.config.ext-config[2].group=prod +#spring.cloud.nacos.config.ext-config[2].refresh=true \ No newline at end of file diff --git a/dq-financial-crms/src/main/resources/bootstrap.properties b/dq-financial-crms/src/main/resources/bootstrap.properties index 95bb071b..496d126e 100644 --- a/dq-financial-crms/src/main/resources/bootstrap.properties +++ b/dq-financial-crms/src/main/resources/bootstrap.properties @@ -1,3 +1,4 @@ +# 开发和测试环境(dev) #服务名称 spring.application.name=dq-financial-crms #配置中心地址 @@ -15,4 +16,24 @@ spring.cloud.nacos.config.ext-config[1].refresh=true spring.cloud.nacos.config.ext-config[2].data-id=other.yml spring.cloud.nacos.config.ext-config[2].group=dev -spring.cloud.nacos.config.ext-config[2].refresh=true \ No newline at end of file +spring.cloud.nacos.config.ext-config[2].refresh=true + +# 正式环境(prod) +#服务名称 +#spring.application.name=dq-financial-crms +##配置中心地址 +#spring.cloud.nacos.config.server-addr=120.78.127.12:8848 +#spring.cloud.nacos.config.namespace=25ce05e2-a0eb-4842-92e4-d8b550a489dd +##spring.cloud.nacos.config.group=prod +# +#spring.cloud.nacos.config.ext-config[0].data-id=datasource.yml +#spring.cloud.nacos.config.ext-config[0].group=prod +#spring.cloud.nacos.config.ext-config[0].refresh=true +# +#spring.cloud.nacos.config.ext-config[1].data-id=mybatis.yml +#spring.cloud.nacos.config.ext-config[1].group=prod +#spring.cloud.nacos.config.ext-config[1].refresh=true +# +#spring.cloud.nacos.config.ext-config[2].data-id=other.yml +#spring.cloud.nacos.config.ext-config[2].group=prod +#spring.cloud.nacos.config.ext-config[2].refresh=true \ No newline at end of file diff --git a/dq-financial-hrms-auth/src/main/resources/bootstrap.properties b/dq-financial-hrms-auth/src/main/resources/bootstrap.properties index c86389db..b2c4518d 100644 --- a/dq-financial-hrms-auth/src/main/resources/bootstrap.properties +++ b/dq-financial-hrms-auth/src/main/resources/bootstrap.properties @@ -1,7 +1,6 @@ - -#�������� +# 开发和测试环境(dev) spring.application.name=dq-financial-hrms-auth -#�������ĵ�ַ + spring.cloud.nacos.config.server-addr=192.168.31.142:8848 spring.cloud.nacos.config.namespace=7632bdaa-3381-4669-b3f9-2fc73be451e8 #spring.cloud.nacos.config.group=prod @@ -27,3 +26,33 @@ spring.redis.jedis.pool.max-active=8 spring.redis.jedis.pool.max-wait=-1 spring.redis.jedis.pool.max-idle=8 spring.redis.jedis.pool.min-idle=0 + + +# 正式环境(prod) +#spring.application.name=dq-financial-hrms-auth +# +#spring.cloud.nacos.config.server-addr=120.78.127.12:8848 +#spring.cloud.nacos.config.namespace=b590c830-7ada-44b7-968f-e8d0c81990c4 +##spring.cloud.nacos.config.group=prod +# +#spring.cloud.nacos.config.ext-config[0].data-id=datasource.yml +#spring.cloud.nacos.config.ext-config[0].group=prod +#spring.cloud.nacos.config.ext-config[0].refresh=true +# +#spring.cloud.nacos.config.ext-config[1].data-id=mybatis.yml +#spring.cloud.nacos.config.ext-config[1].group=prod +#spring.cloud.nacos.config.ext-config[1].refresh=true +# +#spring.cloud.nacos.config.ext-config[2].data-id=other.yml +#spring.cloud.nacos.config.ext-config[2].group=prod +#spring.cloud.nacos.config.ext-config[2].refresh=true +# +#spring.redis.host=127.0.0.1 +#spring.redis.port=6379 +#spring.redis.password=dq123456 +#spring.redis.database=0 +#spring.redis.timeout=30000 +#spring.redis.jedis.pool.max-active=8 +#spring.redis.jedis.pool.max-wait=-1 +#spring.redis.jedis.pool.max-idle=8 +#spring.redis.jedis.pool.min-idle=0 \ No newline at end of file diff --git a/dq-financial-hrms/src/main/resources/bootstrap.properties b/dq-financial-hrms/src/main/resources/bootstrap.properties index d1c6bdec..f4b7fb4e 100644 --- a/dq-financial-hrms/src/main/resources/bootstrap.properties +++ b/dq-financial-hrms/src/main/resources/bootstrap.properties @@ -1,3 +1,4 @@ +# 开发和测试环境(dev) #服务名称 spring.application.name=dq-financial-hrms #配置中心地址 @@ -15,4 +16,24 @@ spring.cloud.nacos.config.ext-config[1].refresh=true spring.cloud.nacos.config.ext-config[2].data-id=other.yml spring.cloud.nacos.config.ext-config[2].group=dev -spring.cloud.nacos.config.ext-config[2].refresh=true \ No newline at end of file +spring.cloud.nacos.config.ext-config[2].refresh=true + +# 正式环境(prod) +#服务名称 +#spring.application.name=dq-financial-hrms +##配置中心地址 +#spring.cloud.nacos.config.server-addr=120.78.127.12:8848 +#spring.cloud.nacos.config.namespace=69614b55-1521-421c-ac58-dbe4a5b01b43 +##spring.cloud.nacos.config.group=prod +# +#spring.cloud.nacos.config.ext-config[0].data-id=datasource.yml +#spring.cloud.nacos.config.ext-config[0].group=prod +#spring.cloud.nacos.config.ext-config[0].refresh=true +# +#spring.cloud.nacos.config.ext-config[1].data-id=mybatis.yml +#spring.cloud.nacos.config.ext-config[1].group=prod +#spring.cloud.nacos.config.ext-config[1].refresh=true +# +#spring.cloud.nacos.config.ext-config[2].data-id=other.yml +#spring.cloud.nacos.config.ext-config[2].group=prod +#spring.cloud.nacos.config.ext-config[2].refresh=true \ No newline at end of file diff --git a/dq-govern-gateway/src/main/resources/bootstrap.properties b/dq-govern-gateway/src/main/resources/bootstrap.properties index 5d6a98ae..fce1c85d 100644 --- a/dq-govern-gateway/src/main/resources/bootstrap.properties +++ b/dq-govern-gateway/src/main/resources/bootstrap.properties @@ -1,3 +1,4 @@ +# 开发和测试环境(dev) #服务名称 spring.application.name=dq-govern-gateway #配置中心地址 @@ -6,4 +7,16 @@ spring.cloud.nacos.config.namespace=772e2607-b929-4246-9671-ee5a36d74d25 spring.cloud.nacos.config.ext-config[0].data-id=dq-govern-gateway.yml spring.cloud.nacos.config.ext-config[0].group=dev -spring.cloud.nacos.config.ext-config[0].refresh=true \ No newline at end of file +spring.cloud.nacos.config.ext-config[0].refresh=true + + +# 正式环境(prod) +#服务名称 +#spring.application.name=dq-govern-gateway +##配置中心地址 +#spring.cloud.nacos.config.server-addr=120.78.127.12:8848 +#spring.cloud.nacos.config.namespace=68738215-903f-426c-8658-2dcd99b20009 +# +#spring.cloud.nacos.config.ext-config[0].data-id=dq-govern-gateway.yml +#spring.cloud.nacos.config.ext-config[0].group=prod +#spring.cloud.nacos.config.ext-config[0].refresh=true \ No newline at end of file From 0b7f45d9b31dca3475a1e55a9e0c65d62af79eba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E9=A3=9E=E4=BA=91?= <1941783199@qq.com> Date: Sat, 10 Oct 2020 09:59:57 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=AD=A3=E5=BC=8F?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/bootstrap.properties | 12 +++++++++++- .../src/main/resources/bootstrap.properties | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/dq-financial-hrms/src/main/resources/bootstrap.properties b/dq-financial-hrms/src/main/resources/bootstrap.properties index 27f2c858..bcab82bd 100644 --- a/dq-financial-hrms/src/main/resources/bootstrap.properties +++ b/dq-financial-hrms/src/main/resources/bootstrap.properties @@ -45,4 +45,14 @@ spring.redis.jedis.pool.min-idle=0 # #spring.cloud.nacos.config.ext-config[2].data-id=other.yml #spring.cloud.nacos.config.ext-config[2].group=prod -#spring.cloud.nacos.config.ext-config[2].refresh=true \ No newline at end of file +#spring.cloud.nacos.config.ext-config[2].refresh=true + +#spring.redis.host=127.0.0.1 +#spring.redis.port=6379 +#spring.redis.password=dq123456 +#spring.redis.database=0 +#spring.redis.timeout=30000 +#spring.redis.jedis.pool.max-active=8 +#spring.redis.jedis.pool.max-wait=-1 +#spring.redis.jedis.pool.max-idle=8 +#spring.redis.jedis.pool.min-idle=0 \ No newline at end of file diff --git a/dq-govern-gateway/src/main/resources/bootstrap.properties b/dq-govern-gateway/src/main/resources/bootstrap.properties index 81fe096f..03863fe9 100644 --- a/dq-govern-gateway/src/main/resources/bootstrap.properties +++ b/dq-govern-gateway/src/main/resources/bootstrap.properties @@ -28,4 +28,14 @@ spring.redis.jedis.pool.min-idle=0 # #spring.cloud.nacos.config.ext-config[0].data-id=dq-govern-gateway.yml #spring.cloud.nacos.config.ext-config[0].group=prod -#spring.cloud.nacos.config.ext-config[0].refresh=true \ No newline at end of file +#spring.cloud.nacos.config.ext-config[0].refresh=true + +#spring.redis.host=127.0.0.1 +#spring.redis.port=6379 +#spring.redis.password=dq123456 +#spring.redis.database=0 +#spring.redis.timeout=30000 +#spring.redis.jedis.pool.max-active=8 +#spring.redis.jedis.pool.max-wait=-1 +#spring.redis.jedis.pool.max-idle=8 +#spring.redis.jedis.pool.min-idle=0 \ No newline at end of file