From faf4b8dd478a25bf99eaf81917969d4442c23a83 Mon Sep 17 00:00:00 2001 From: hxrui <1490493387@qq.com> Date: Fri, 26 Feb 2021 20:38:57 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E5=BC=95=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/youlai/mall/ums/UmsApplication.java | 2 -- .../java/com/youlai/auth/controller/AuthController.java | 7 +++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/UmsApplication.java b/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/UmsApplication.java index 2cc39b539..6a72a9052 100644 --- a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/UmsApplication.java +++ b/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/UmsApplication.java @@ -1,6 +1,5 @@ package com.youlai.mall.ums; -import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; @@ -8,7 +7,6 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient; @SpringBootApplication(exclude = DataSourceAutoConfiguration.class) @EnableDiscoveryClient -@MapperScan("com.youlai.mall.ums.mapper") public class UmsApplication { public static void main(String[] args) { SpringApplication.run(UmsApplication.class); 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 8942c26c1..f7fde408e 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 @@ -64,6 +64,13 @@ public class AuthController { ) throws HttpRequestMethodNotSupportedException { OAuth2AccessToken oAuth2AccessToken; + /** + * 获取登录认证的客户端ID + * + * 兼容两种方式获取Oauth2客户端信息(client_id、client_secret) + * 方式一:client_id、client_secret放在请求路径中 + * 方式二:放在请求头(Request Headers)中的Authorization字段,且经过加密,例如 Basic Y2xpZW50OnNlY3JldA== 明文等于 client:secret + */ String clientId = RequestUtils.getAuthClientId(); switch (clientId) { case AuthConstants.WEAPP_CLIENT_ID: // 微信认证