From cd73d8bb9b89b6b262e17194563d749ea02969fd Mon Sep 17 00:00:00 2001 From: haoxr <1490493387@qq.com> Date: Tue, 8 Jun 2021 01:27:17 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=BE=AE=E4=BF=A1=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E7=94=A8=E6=88=B7=E7=99=BB=E5=BD=95=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/youlai/mall/oms/api/OrderFeignClient.java | 4 ---- .../java/com/youlai/auth/controller/OAuthController.java | 9 ++------- .../main/java/com/youlai/auth/service/WeAppService.java | 1 + 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/api/OrderFeignClient.java b/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/api/OrderFeignClient.java index 3710022e2..8230c31b3 100644 --- a/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/api/OrderFeignClient.java +++ b/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/api/OrderFeignClient.java @@ -1,10 +1,6 @@ package com.youlai.mall.oms.api; -import com.youlai.common.result.Result; import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestParam; /** * @author haoxr diff --git a/youlai-auth/src/main/java/com/youlai/auth/controller/OAuthController.java b/youlai-auth/src/main/java/com/youlai/auth/controller/OAuthController.java index 4e3286569..5d57e190b 100644 --- a/youlai-auth/src/main/java/com/youlai/auth/controller/OAuthController.java +++ b/youlai-auth/src/main/java/com/youlai/auth/controller/OAuthController.java @@ -53,7 +53,6 @@ public class OAuthController { @ApiIgnore Principal principal, @ApiIgnore @RequestParam Map parameters ) throws HttpRequestMethodNotSupportedException { - JwtTokenPair jwtTokenPair = new JwtTokenPair(); /** * 获取登录认证的客户端ID @@ -64,18 +63,14 @@ public class OAuthController { */ String clientId = JwtUtils.getAuthClientId(); OAuthClientEnum client = OAuthClientEnum.getByClientId(clientId); - switch (client) { case WEAPP: // 微信小程序 - jwtTokenPair = weAppService.login(parameters); - break; + return Result.success(weAppService.login(parameters)); case TEST: // knife4j接口测试文档使用 client_id/client_secret : client/123456 return tokenEndpoint.postAccessToken(principal, parameters).getBody(); default: -// oAuth2AccessToken = tokenEndpoint.postAccessToken(principal, parameters).getBody(); - break; + return Result.success(tokenEndpoint.postAccessToken(principal, parameters).getBody()); } - return Result.success(jwtTokenPair); } @ApiOperation(value = "注销", notes = "logout") diff --git a/youlai-auth/src/main/java/com/youlai/auth/service/WeAppService.java b/youlai-auth/src/main/java/com/youlai/auth/service/WeAppService.java index c2fec23c2..e04df7931 100644 --- a/youlai-auth/src/main/java/com/youlai/auth/service/WeAppService.java +++ b/youlai-auth/src/main/java/com/youlai/auth/service/WeAppService.java @@ -53,6 +53,7 @@ public class WeAppService { public JwtTokenPair login(Map parameters) { String code = parameters.get("code"); + String userInfo = parameters.get("userInfo"); if (StrUtil.isBlank(code)) { throw new BizException("code不能为空");