diff --git a/pom.xml b/pom.xml index 9b35be0..234336c 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.tiesheng.springboot-parent springboot-parent - 2.0.31 + 2.0.32 pom springboot-parent 杭州铁晟科技有限公司基础依赖 @@ -59,49 +59,49 @@ com.tiesheng.springboot-parent springboot-database - 2.0.31 + 2.0.32 com.tiesheng.springboot-parent springboot-login - 2.0.31 + 2.0.32 com.tiesheng.springboot-parent springboot-web - 2.0.31 + 2.0.32 com.tiesheng.springboot-parent springboot-util - 2.0.31 + 2.0.32 com.tiesheng.springboot-parent springboot-platform - 2.0.31 + 2.0.32 com.tiesheng.springboot-parent springboot-message - 2.0.31 + 2.0.32 com.tiesheng.springboot-parent springboot-role - 2.0.31 + 2.0.32 com.tiesheng.springboot-parent springboot-annotation - 2.0.31 + 2.0.32 diff --git a/springboot-ademo/pom.xml b/springboot-ademo/pom.xml index 75e9085..7765897 100644 --- a/springboot-ademo/pom.xml +++ b/springboot-ademo/pom.xml @@ -6,11 +6,11 @@ com.tiesheng.springboot-parent springboot-parent - 2.0.31 + 2.0.32 springboot-ademo - 2.0.31 + 2.0.32 8 diff --git a/springboot-annotation/pom.xml b/springboot-annotation/pom.xml index 5b5fa2b..9a78c8f 100644 --- a/springboot-annotation/pom.xml +++ b/springboot-annotation/pom.xml @@ -6,7 +6,7 @@ com.tiesheng.springboot-parent springboot-parent - 2.0.31 + 2.0.32 springboot-annotation diff --git a/springboot-chart/pom.xml b/springboot-chart/pom.xml index f14b61f..ed897d0 100644 --- a/springboot-chart/pom.xml +++ b/springboot-chart/pom.xml @@ -6,7 +6,7 @@ com.tiesheng.springboot-parent springboot-parent - 2.0.31 + 2.0.32 springboot-chart diff --git a/springboot-database/pom.xml b/springboot-database/pom.xml index 4b45e19..da1aedd 100644 --- a/springboot-database/pom.xml +++ b/springboot-database/pom.xml @@ -6,7 +6,7 @@ com.tiesheng.springboot-parent springboot-parent - 2.0.31 + 2.0.32 springboot-database diff --git a/springboot-login/pom.xml b/springboot-login/pom.xml index d17ad12..503ebc0 100644 --- a/springboot-login/pom.xml +++ b/springboot-login/pom.xml @@ -6,7 +6,7 @@ com.tiesheng.springboot-parent springboot-parent - 2.0.31 + 2.0.32 springboot-login diff --git a/springboot-message/pom.xml b/springboot-message/pom.xml index 8bfa59e..756f117 100644 --- a/springboot-message/pom.xml +++ b/springboot-message/pom.xml @@ -6,7 +6,7 @@ com.tiesheng.springboot-parent springboot-parent - 2.0.31 + 2.0.32 springboot-message diff --git a/springboot-platform/pom.xml b/springboot-platform/pom.xml index 5fb63be..d34025a 100644 --- a/springboot-platform/pom.xml +++ b/springboot-platform/pom.xml @@ -6,7 +6,7 @@ com.tiesheng.springboot-parent springboot-parent - 2.0.31 + 2.0.32 springboot-platform diff --git a/springboot-platform/src/main/java/com/tiesheng/platform/config/wxmp/PlatformWxmpConfig.java b/springboot-platform/src/main/java/com/tiesheng/platform/config/wxmp/PlatformWxmpConfig.java index 3141a43..dc4f820 100644 --- a/springboot-platform/src/main/java/com/tiesheng/platform/config/wxmp/PlatformWxmpConfig.java +++ b/springboot-platform/src/main/java/com/tiesheng/platform/config/wxmp/PlatformWxmpConfig.java @@ -141,7 +141,13 @@ public class PlatformWxmpConfig { public WxUserInfo getOAuth2AccessToken(String service, String code) { WxConfigBean configBean = getConfigBean(service); WxOAuth2AccessToken wxOAuth2AccessToken = WxOAuth2AccessToken.create(configBean.getAppId(), configBean.getAppSecret(), code); - WxUserInfo wxUserInfo = WxUserInfo.create(wxOAuth2AccessToken); + WxUserInfo wxUserInfo; + if (configBean.canUserInfo()) { + wxUserInfo = WxUserInfo.create(wxOAuth2AccessToken); + } else { + wxUserInfo = new WxUserInfo(); + wxUserInfo.setOpenid(wxOAuth2AccessToken.getOpenid()); + } wxUserInfo.setAppId(configBean.getAppId()); return wxUserInfo; } @@ -162,7 +168,8 @@ public class PlatformWxmpConfig { /////////////////////////////////////////////////////////////////////////// // setter\getter - /////////////////////////////////////////////////////////////////////////// + + /// //////////////////////////////////////////////////////////////////////// public Map getConfigs() { return configs; diff --git a/springboot-platform/src/main/java/com/tiesheng/platform/config/wxmp/bean/WxConfigBean.java b/springboot-platform/src/main/java/com/tiesheng/platform/config/wxmp/bean/WxConfigBean.java index fe740f8..8799b62 100644 --- a/springboot-platform/src/main/java/com/tiesheng/platform/config/wxmp/bean/WxConfigBean.java +++ b/springboot-platform/src/main/java/com/tiesheng/platform/config/wxmp/bean/WxConfigBean.java @@ -9,6 +9,15 @@ public class WxConfigBean { private String appSecret; private String scope = "snsapi_base"; + /** + * 是否可以获取用户信息 + * + * @return + */ + public boolean canUserInfo() { + return !"snsapi_base".equals(scope); + } + /////////////////////////////////////////////////////////////////////////// // setter\getter diff --git a/springboot-role/pom.xml b/springboot-role/pom.xml index 838285f..591f475 100644 --- a/springboot-role/pom.xml +++ b/springboot-role/pom.xml @@ -6,7 +6,7 @@ com.tiesheng.springboot-parent springboot-parent - 2.0.31 + 2.0.32 springboot-role diff --git a/springboot-util/pom.xml b/springboot-util/pom.xml index f10b815..e15cf8a 100644 --- a/springboot-util/pom.xml +++ b/springboot-util/pom.xml @@ -6,7 +6,7 @@ com.tiesheng.springboot-parent springboot-parent - 2.0.31 + 2.0.32 springboot-util diff --git a/springboot-web/pom.xml b/springboot-web/pom.xml index 97c1364..c93c405 100644 --- a/springboot-web/pom.xml +++ b/springboot-web/pom.xml @@ -6,7 +6,7 @@ com.tiesheng.springboot-parent springboot-parent - 2.0.31 + 2.0.32 springboot-web