|
@@ -362,7 +362,7 @@ public class CmsAdminUserController {
|
|
|
* 网页微信授权后跳转
|
|
* 网页微信授权后跳转
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/wx/authLogin/baseRedirect")
|
|
@GetMapping("/wx/authLogin/baseRedirect")
|
|
|
- public void wxAuthLoginRedirect(String code, String state, HttpServletResponse response) throws Exception {
|
|
|
|
|
|
|
+ public Result<String> wxAuthLoginRedirect(String code, String state, HttpServletResponse response) throws Exception {
|
|
|
if (StrUtil.isEmpty(state)) throw BusinessRuntimeException.getInstance("授权错误,请重新授权");
|
|
if (StrUtil.isEmpty(state)) throw BusinessRuntimeException.getInstance("授权错误,请重新授权");
|
|
|
String json = Codec.DoBase64.custom().setData(state).decodeAsText();
|
|
String json = Codec.DoBase64.custom().setData(state).decodeAsText();
|
|
|
AuthRedirect re = Jsons.parseObject(json, AuthRedirect.class);
|
|
AuthRedirect re = Jsons.parseObject(json, AuthRedirect.class);
|
|
@@ -384,8 +384,7 @@ public class CmsAdminUserController {
|
|
|
jsonObject.put("unionid", unionId);
|
|
jsonObject.put("unionid", unionId);
|
|
|
String bindWxKey = RandomUtil.randomString(10);
|
|
String bindWxKey = RandomUtil.randomString(10);
|
|
|
redisService.set("cms_bind_wx:" + bindWxKey, jsonObject.toString(), 12 * 60L);
|
|
redisService.set("cms_bind_wx:" + bindWxKey, jsonObject.toString(), 12 * 60L);
|
|
|
-
|
|
|
|
|
- throw BusinessRuntimeException.getInstance("请绑定登录信息");
|
|
|
|
|
|
|
+ return GatewayResponse.FAIL.newBuilder().toResult(bindWxKey);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
StpUtil.login(user.getId());
|
|
StpUtil.login(user.getId());
|
|
@@ -394,6 +393,7 @@ public class CmsAdminUserController {
|
|
|
if (StrUtil.isNotBlank(url)) {
|
|
if (StrUtil.isNotBlank(url)) {
|
|
|
response.sendRedirect(url.contains("?") ? url + "&t=" + cmsToken : url + "?t=" + cmsToken);
|
|
response.sendRedirect(url.contains("?") ? url + "&t=" + cmsToken : url + "?t=" + cmsToken);
|
|
|
}
|
|
}
|
|
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|