Skip to content

Commit

Permalink
注册页、重置密码页添加右上角系统菜单
Browse files Browse the repository at this point in the history
  • Loading branch information
interestinglife committed Aug 26, 2021
1 parent 1e3d2cf commit 67908ee
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void setUserService(UserService userService)
}

@RequestMapping
public String register(HttpServletRequest request, org.springframework.ui.Model model)
public String register(HttpServletRequest request, HttpServletResponse response, org.springframework.ui.Model model)
{
if (this.applicationProperties.isDisableRegister())
{
Expand All @@ -86,6 +86,8 @@ public String register(HttpServletRequest request, org.springframework.ui.Model
User user = new User();

model.addAttribute("user", user);
request.setAttribute("currentUser", WebUtils.getUser(request, response).cloneNoPassword());
setDetectNewVersionScriptAttr(request, response, this.applicationProperties.isDisableDetectNewVersion());

return "/register";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
import org.datagear.management.service.UserService;
import org.datagear.util.FileUtil;
import org.datagear.util.IDUtil;
import org.datagear.web.config.ApplicationProperties;
import org.datagear.web.util.OperationMessage;
import org.datagear.web.util.WebUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
Expand Down Expand Up @@ -47,6 +49,9 @@ public class ResetPasswordController extends AbstractController
@Autowired
private File resetPasswordCheckFileDirectory;

@Autowired
private ApplicationProperties applicationProperties;

public ResetPasswordController()
{
super();
Expand All @@ -72,8 +77,18 @@ public void setResetPasswordCheckFileDirectory(File resetPasswordCheckFileDirect
this.resetPasswordCheckFileDirectory = resetPasswordCheckFileDirectory;
}

public ApplicationProperties getApplicationProperties()
{
return applicationProperties;
}

public void setApplicationProperties(ApplicationProperties applicationProperties)
{
this.applicationProperties = applicationProperties;
}

@RequestMapping
public String resetPassword(HttpServletRequest request)
public String resetPassword(HttpServletRequest request, HttpServletResponse response)
{
HttpSession session = request.getSession();

Expand All @@ -88,6 +103,8 @@ public String resetPassword(HttpServletRequest request)
}

request.setAttribute("step", resetPasswordStep);
request.setAttribute("currentUser", WebUtils.getUser(request, response).cloneNoPassword());
setDetectNewVersionScriptAttr(request, response, this.applicationProperties.isDisableDetectNewVersion());

return "/reset_password";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<html>
<head>
<#include "include/html_head.ftl">
${detectNewVersionScript?no_esc}
<title><#include "include/html_title_app_name.ftl"><@spring.message code='register.register' /></title>
</head>
<body>
Expand All @@ -19,6 +20,7 @@
<div class="main-page-head">
<#include "include/html_logo.ftl">
<div class="toolbar">
<#include "include/page_obj_sys_menu.ftl">
<a class="link" href="${contextPath}/login"><@spring.message code='login.login' /></a>
<a class="link" href="${contextPath}/"><@spring.message code='backToMainPage' /></a>
</div>
Expand Down Expand Up @@ -122,6 +124,8 @@
});
$(".ui-dialog .ui-dialog-titlebar-close", dialog.widget).hide();
po.initSysMenu();
})
(${pageId});
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<html>
<head>
<#include "include/html_head.ftl">
${detectNewVersionScript?no_esc}
<#if step.finalStep>
<meta http-equiv="refresh" content="4;url=${contextPath}/login">
</#if>
Expand All @@ -23,6 +24,7 @@
<div class="main-page-head main-page-head-reset-passord">
<#include "include/html_logo.ftl">
<div class="toolbar">
<#include "include/page_obj_sys_menu.ftl">
<a class="link" href="${contextPath}/login"><@spring.message code='resetPassword.backToLoginPage' /></a>
<a class="link" href="${contextPath}/"><@spring.message code='backToMainPage' /></a>
</div>
Expand Down Expand Up @@ -144,6 +146,8 @@
});
}
});
po.initSysMenu();
})
(${pageId});
</script>
Expand Down

0 comments on commit 67908ee

Please sign in to comment.