fix - 调整登陆成功后的页面地址
This commit is contained in:
parent
f577b818bc
commit
e9e2c026ad
@ -298,21 +298,7 @@ public class DangerOperationController {
|
||||
session.setAttribute("isAuthenticated", true);
|
||||
// 可以把用户信息也存进去
|
||||
session.setAttribute("dingUser", userJson);
|
||||
|
||||
// 重定向回表单页,使用完整的URL包括域名和contextPath
|
||||
String scheme = request.getScheme(); // http 或 https
|
||||
String serverName = request.getServerName(); // 服务器名称
|
||||
int serverPort = request.getServerPort(); // 端口号
|
||||
String contextPath = request.getContextPath(); // 上下文路径
|
||||
|
||||
StringBuilder redirectUrl = new StringBuilder();
|
||||
redirectUrl.append(scheme).append("://").append(serverName);
|
||||
if (("http".equals(scheme) && serverPort != 80) || ("https".equals(scheme) && serverPort != 443)) {
|
||||
redirectUrl.append(":").append(serverPort);
|
||||
}
|
||||
redirectUrl.append(contextPath).append("/web/process/form");
|
||||
|
||||
return "redirect:" + redirectUrl.toString();
|
||||
return "form";
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("DingTalk Callback Error", e);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user