From c7318dcc2a45ed337abd58ab40bd16f1edf6ac4d Mon Sep 17 00:00:00 2001 From: "DESKTOP-G8BCEP0\\HP" <2037158277@qq.com> Date: Mon, 13 Sep 2021 10:46:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E6=89=AB=E7=A0=81=E7=99=BB=E5=BD=95=E7=9A=84=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xkrs/common/config/ConstantConfig.java | 29 +++++++++++++++++++ .../xkrs/service/impl/SysUserServiceImpl.java | 2 +- src/main/resources/application.properties | 9 +++++- 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/xkrs/common/config/ConstantConfig.java diff --git a/src/main/java/com/xkrs/common/config/ConstantConfig.java b/src/main/java/com/xkrs/common/config/ConstantConfig.java new file mode 100644 index 0000000..b70a371 --- /dev/null +++ b/src/main/java/com/xkrs/common/config/ConstantConfig.java @@ -0,0 +1,29 @@ +package com.xkrs.common.config; + +import org.springframework.beans.factory.InitializingBean; +import org.springframework.beans.factory.annotation.Value; + +/** + * @author XinYi Song + */ +public class ConstantConfig implements InitializingBean { + + @Value("${wx.open.app_id}") + private String appId; + + @Value("${wx.open.app_secret}") + private String appSecret; + + @Value("${wx.open.redirect_url}") + private String redirectUrl; + + public static String WX_OPEN_APP_ID; + public static String WX_OPEN_APP_SECRET; + public static String WX_OPEN_REDIRECT_URL; + @Override + public void afterPropertiesSet() throws Exception { + WX_OPEN_APP_ID = appId; + WX_OPEN_APP_SECRET = appSecret; + WX_OPEN_REDIRECT_URL = redirectUrl; + } +} diff --git a/src/main/java/com/xkrs/service/impl/SysUserServiceImpl.java b/src/main/java/com/xkrs/service/impl/SysUserServiceImpl.java index 90397e0..da50b52 100644 --- a/src/main/java/com/xkrs/service/impl/SysUserServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/SysUserServiceImpl.java @@ -270,7 +270,7 @@ public class SysUserServiceImpl implements SysUserService { response.setCharacterEncoding("UTF-8"); String token = TokenAuthenticationService.addAuthentications(response, authToken.getName(), authToken.getAuthorities()); map.put("token",token); - map.put("type",1); + map.put("type","1"); return outputEncapsulationObject(PromptMessageEnum.SUCCESS,map,locale); } } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index d23403d..8422f2e 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -29,7 +29,7 @@ spring.datasource.hikari.validation-timeout = 3000 ## Spring Data JPA 配置 spring.jpa.database = POSTGRESQL spring.jpa.database-platform = org.hibernate.dialect.PostgreSQLDialect -spring.jpa.show-sql = false +spring.jpa.show-sql = true # 指定 ddl mode (none, validate, create, create-drop, update) spring.jpa.hibernate.ddl-auto = update # 命名策略 @@ -77,3 +77,10 @@ my.MaxLoginErrorCount = 5 ## 自定义用户登录错误间隔时间(分钟) my.LoginErrorIntervalTime = 60 + +# 微信开放平台 appid +wx.open.app_id=你的appid +# 微信开放平台 appsecret +wx.open.app_secret=你的appsecret +# 微信开放平台 重定向url +wx.open.redirect_url=http://你的服务器名称/api/ucenter/wx/callback