三江-app统一登录
This commit is contained in:
parent
aab253c919
commit
6e4235364b
@ -41,6 +41,8 @@ public class SjLoginController {
|
||||
public static String SJ_TOKEN_PREFIX = "SJ_UNIFIEDAUTHENTICATION_TOKEN:";
|
||||
@Value("${sj.unifiedAuthentication.success.redirect:}")
|
||||
private String sjUnifiedAuthenticationSuccessRedirect;
|
||||
@Value("${sj.unifiedAuthentication.success.redirect.app:}")
|
||||
private String sjUnifiedAuthenticationSuccessRedirectApp;
|
||||
|
||||
/**
|
||||
* 根据code获取token
|
||||
@ -48,10 +50,11 @@ public class SjLoginController {
|
||||
* @param code
|
||||
* @param response
|
||||
* @param request
|
||||
* @param platform app还是pc端
|
||||
* @throws IOException
|
||||
*/
|
||||
@GetMapping("/getTokenByCode")
|
||||
public void getTokenByCode(@RequestParam String code, HttpServletResponse response, HttpServletRequest request) throws IOException, InvalidKeySpecException {
|
||||
public void getTokenByCode(@RequestParam String code, String platform, HttpServletResponse response, HttpServletRequest request) throws IOException, InvalidKeySpecException {
|
||||
//根据授权码获取令牌
|
||||
log.info("code:{}", code);
|
||||
TokenResponse tokenByCode = sjUnifiedAuthenticationHttpUtil.getTokenByCode(code);
|
||||
@ -64,9 +67,13 @@ public class SjLoginController {
|
||||
, Long.parseLong(tokenByCode.getRe_expires_in()), TimeUnit.SECONDS);
|
||||
}
|
||||
}
|
||||
//获取用户信息
|
||||
//重定向到应用页面(一般为首页)
|
||||
response.sendRedirect(sjUnifiedAuthenticationSuccessRedirect + access_token);
|
||||
if (StringUtils.isBlank(platform)) {
|
||||
//重定向到应用页面(一般为首页)pc端
|
||||
response.sendRedirect(sjUnifiedAuthenticationSuccessRedirect + access_token);
|
||||
} else {
|
||||
//重定向到应用页面(一般为首页)app端
|
||||
response.sendRedirect(sjUnifiedAuthenticationSuccessRedirectApp + access_token);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -81,13 +81,14 @@ uop_sync_mq_username=admin
|
||||
uop_sync_mq_password=admin
|
||||
#\u4E09\u6C5F\u5F00\u542F\u6D88\u606F\u63A5\u6536
|
||||
c2_orguser_subscription=true
|
||||
|
||||
#\u4E09\u6C5F\u7EDF\u4E00\u767B\u5F55\u5730\u5740
|
||||
sj.unifiedAuthentication.login.url=http://116.169.63.183:30913
|
||||
#\u4E09\u6C5F\u7EDF\u4E00\u767B\u5F55\u6210\u529F\u8DF3\u8F6C\u540E\u63A5\u6536code\u7684\u5730\u5740
|
||||
#sj.unifiedAuthentication.login.code.url=http://wbtqry.natappfree.cc/xmgl/sj/unifiedAuthentication/getTokenByCode
|
||||
#\u4E09\u6C5F\u7EDF\u4E00\u767B\u5F55\u6210\u529F\u540E\u8DF3\u8F6Curl
|
||||
sj.unifiedAuthentication.success.redirect=http://192.168.34.226:8080/index.html#/login?UID=
|
||||
#\u4E09\u6C5F\u7EDF\u4E00\u767B\u5F55\u6210\u529F\u540E\u8DF3\u8F6Curl\uFF08pc\u7AEF\uFF09
|
||||
sj.unifiedAuthentication.success.redirect=http://192.168.34.226:8080/index.html#/login?UID=\
|
||||
#\u4E09\u6C5F\u7EDF\u4E00\u767B\u5F55\u6210\u529F\u540E\u8DF3\u8F6Curl\uFF08app\u7AEF\uFF09
|
||||
sj.unifiedAuthentication.success.redirect.app=http://192.168.34.226:8080/index.html#/login?UID=
|
||||
#\u4E09\u6C5F\u4E1A\u52A1\u4E2D\u53F0\u7F51\u5173\u5730\u5740
|
||||
sj.business.gateway.url=http://116.169.63.183:30867/
|
||||
#\u4E09\u6C5F\u4E1A\u52A1\u4E2D\u53F0\u7F51\u5173\u5730\u5740\u7684\u8C03\u7528\u51ED\u8BC1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user