添加了微信扫码登录的配置信息

This commit is contained in:
DESKTOP-G8BCEP0\HP 2021-09-13 10:46:04 +08:00
parent ca749e43b1
commit c7318dcc2a
3 changed files with 38 additions and 2 deletions

View File

@ -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;
}
}

View File

@ -270,7 +270,7 @@ public class SysUserServiceImpl implements SysUserService {
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
String token = TokenAuthenticationService.addAuthentications(response, authToken.getName(), authToken.getAuthorities()); String token = TokenAuthenticationService.addAuthentications(response, authToken.getName(), authToken.getAuthorities());
map.put("token",token); map.put("token",token);
map.put("type",1); map.put("type","1");
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,map,locale); return outputEncapsulationObject(PromptMessageEnum.SUCCESS,map,locale);
} }
} }

View File

@ -29,7 +29,7 @@ spring.datasource.hikari.validation-timeout = 3000
## Spring Data JPA 配置 ## Spring Data JPA 配置
spring.jpa.database = POSTGRESQL spring.jpa.database = POSTGRESQL
spring.jpa.database-platform = org.hibernate.dialect.PostgreSQLDialect 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) # 指定 ddl mode (none, validate, create, create-drop, update)
spring.jpa.hibernate.ddl-auto = update spring.jpa.hibernate.ddl-auto = update
# 命名策略 # 命名策略
@ -77,3 +77,10 @@ my.MaxLoginErrorCount = 5
## 自定义用户登录错误间隔时间(分钟) ## 自定义用户登录错误间隔时间(分钟)
my.LoginErrorIntervalTime = 60 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