소스 검색

cps后台登录跳转

zoujiajian 2 년 전
부모
커밋
d2d4411355

+ 3 - 22
netflix-web/src/main/java/com/cyksj/web/controller/cps/CpsBackLoginController.java

@@ -100,22 +100,12 @@ public class CpsBackLoginController {
 	 */
 	@GetMapping("/wx/authLogin")
 	public Result<CpsAuthDto> wxAuthorize(String redirectUrl) throws Exception {
-		Object authUrlObj = redisService.get(RedisService.key.WX_LOGIN_AUTH_URI.getNameFormat("cps", wxOpenPlatYHLXLoginConfig.getAppId()));
-		if (authUrlObj != null) {
-			CpsAuthDto cpsAuthDto = Jsons.parseObject(authUrlObj.toString(), CpsAuthDto.class);
-			return GatewayResponse.SUCCESS.newBuilder().toResult(cpsAuthDto);
-		}
 		CpsAuthDto cpsAuthDto = new CpsAuthDto();
-		Long mappingId = SEQUENCE.nextId();
-		String authState = mappingId.toString();
-		redisService.set(authState, authState, 60 * 60 * 24L);
-		AuthRedirect redirect = new AuthRedirect().setMappingId(mappingId);
+		AuthRedirect redirect = new AuthRedirect();
 		redirect.setUrl(redirectUrl);
 		String state = Codec.DoBase64.custom().setData(Jsons.toJson(redirect)).encodeAsText();
 		String wxAuthUrl = authorizationService.createWxAuthLoginUrl(state, wxOpenPlatYHLXLoginConfig.getAppId(), wxOpenPlatYHLXLoginConfig.getCpsRedirectUri());
 		cpsAuthDto.setAuthUrl(wxAuthUrl);
-		cpsAuthDto.setAuthState(authState);
-		redisService.set(RedisService.key.WX_LOGIN_AUTH_URI.getNameFormat("cps", wxOpenPlatYHLXLoginConfig.getAppId()), Jsons.toJson(cpsAuthDto), RedisService.key.WX_LOGIN_AUTH_URI.getTimeout());
 		return GatewayResponse.SUCCESS.newBuilder().toResult(cpsAuthDto);
 	}
 
@@ -143,17 +133,8 @@ public class CpsBackLoginController {
 		if (userDistribute == null) throw BusinessRuntimeException.getInstance("只支持渠道分销用户登录");
 		StpCpsManageUser.login(user.getId());
 		String cpsToken = StpCpsManageUser.getTokenValue();
-		String url = re.getUrl();
-		if (StrUtil.isNotBlank(url)) {
-			response.sendRedirect(url.contains("?") ? url + "&t=" + cpsToken : url + "?t=" + cpsToken);
-			return;
-		}
-		JSONObject res = new JSONObject();
-		res.putOpt("satoken-cpsUser", cpsToken);
-		res.putOpt("img", user.getHeadimgurl());
-		res.putOpt("nickname", user.getNickname());
-		redisService.set(RedisService.key.CPS_AUTH_SUCCESS_KEY.getNameFormat(re.getMappingId()), res.toString(), RedisService.key.CPS_BACK_LOGIN_KEY.getTimeout());
-		response.sendRedirect(wxOpenPlatYHLXLoginConfig.getCpsLoginUrl());
+		String url = Optional.ofNullable(re.getUrl()).orElse(wxOpenPlatYHLXLoginConfig.getLoginUrl());
+		response.sendRedirect(url.contains("?") ? url + "&t=" + cpsToken : url + "?t=" + cpsToken);
 	}
 
 	/**

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
netflix-web/src/main/resources/application-prd.yml


+ 1 - 1
netflix-web/src/main/resources/application-pre.yml

@@ -139,7 +139,7 @@ wx-login:
   redirectUri: https://nf.video/8082/api/auth/wx/authLogin/baseRedirect
   loginUrl: https://nf.video
   cpsRedirectUri: https://nf.video/8082/api/cps/manage/wx/authLogin/baseRedirect
-  cpsLoginUrl: https://cps.nf.video/yinhe/cps/loginNexte
+  cpsLoginUrl: https://cps.nf.video/yinhe/cps/homePage
   yhShopRedirectUri: https://nf.video/8082/api/yhShop/manage/wx/authLogin/baseRedirect
   yhShopLoginUrl: https://shop.liuliangbang.vip/mall/admin/loginNexte
   baRedirectUrl: https://nf.video/8082/api/applets/market/task/bind/wx/baseRedirect

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.