From adee1ae2dc168c202528ed9e4597cea03fdb8843 Mon Sep 17 00:00:00 2001 From: haoxr <1490493387@qq.com> Date: Wed, 23 Sep 2020 19:50:42 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E7=99=BB=E5=87=BA=E5=B0=86JWT=E5=8A=A0?= =?UTF-8?q?=E5=85=A5=E9=BB=91=E5=90=8D=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../youlai/auth/controller/AuthController.java | 16 ++++++++++++++++ youlai-auth/src/main/resources/jwt.jks | Bin 2198 -> 0 bytes 2 files changed, 16 insertions(+) delete mode 100644 youlai-auth/src/main/resources/jwt.jks diff --git a/youlai-auth/src/main/java/com/youlai/auth/controller/AuthController.java b/youlai-auth/src/main/java/com/youlai/auth/controller/AuthController.java index d01a0c360..264421003 100644 --- a/youlai-auth/src/main/java/com/youlai/auth/controller/AuthController.java +++ b/youlai-auth/src/main/java/com/youlai/auth/controller/AuthController.java @@ -6,6 +6,8 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; import org.springframework.security.oauth2.common.OAuth2AccessToken; import org.springframework.security.oauth2.provider.endpoint.TokenEndpoint; import org.springframework.web.HttpRequestMethodNotSupportedException; @@ -14,6 +16,7 @@ import springfox.documentation.annotations.ApiIgnore; import javax.annotation.Resource; import java.security.Principal; +import java.util.ArrayList; import java.util.Map; @Api(tags = "认证中心认证登录") @@ -24,6 +27,9 @@ public class AuthController { @Resource private TokenEndpoint tokenEndpoint; + @Autowired + private RedisTemplate redisTemplate; + @ApiOperation("Oauth2获取token") @ApiImplicitParams({ @ApiImplicitParam(name = "grant_type",paramType = "query", defaultValue = "password", value = "授权模式", required = true), @@ -46,4 +52,14 @@ public class AuthController { .build(); return Result.success(oauth2Token); } + + @DeleteMapping("/logout") + public Result logout(){ + + //redisTemplate.opsForHash().putAll("",new ArrayList<>()); + + return null; + } + + } diff --git a/youlai-auth/src/main/resources/jwt.jks b/youlai-auth/src/main/resources/jwt.jks deleted file mode 100644 index 1e3b9cf3e02f8eda80c7e37bbcacbab1d34e79d0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2198 zcmcIl`8(7L7oW|(Hp$}d$ zV_2C#4=jq7UIOOmDOPC7dK?B#B| z;Y+PRRl(9T4-c)niq8amnmmxY5h6fo8Rk^0pDA>9w$pzI_?_%d>EHUUDDh{`&GXH- z^2jo!CxGpwk9_btOngI)k5{}Mj0$?e`=8RP<4u~Qj#fh{HzshvS6i}g`w86Xp5l4G zaYQXoO~0*_@1QDMG_9I?c!MX*HlYUffS&h|%w+XmlKWhDmVbn1YBF3lK4Wl7+E zxe1_m!@91?IW=1^UXVT>q9dw8Sz;_C50&70hw+g;LCQb7{kb^nS2%JRXp5Mg6{&(9 zRNgWDh4i>~*QWcy?D42mwP&^$tp^p4iav~;!?&E2(3oAD_Fl*)=x_9?H}5{4TaiO) z-&=i|(NU$d=vxv$Rz{S`ZM-(=qXT|m@Jxg9Lgsj3)zEBcnq%SDJ*Np8IwBVOXr1i) zbX2%4w*|R*52mcX=EiI@QV;hu$fvBjM19E1`0et?22{koR}D#&1UX#sP}(w*wt``e_3d5Bem3L;80v@QlR5@Br;SnLa?@Q$P-V}}0LI=X1y>U9cd3U|u)XUp%TT3?S zb46r3=pjXEkgl`xDkq>=ghwmyJzslM?sM=g)rQ_VBVA9zp6e9aJebP*Qif4Vr3#tI zn~#~7WnXT}VUO_d%w}5BUqH{363HiSvkvHctkv;;xRv4k$j1iaX5G2|p#renF zlNpXr@&NTl4bM2u8nSL3TQ+X<^uE2UuZ_n}gYhjn8N8)=l1a`qC8{?dbun&#A*^?Ep`{ychxvFae`!3W0AVO^c zB1Ah63IRhPFwo5^D?o^w4@tHnbA-TP0WJ{Wf)W7uxS`H4ZaBm%@E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