diff --git a/tamguo-bms/src/main/java/com/tamguo/config/web/ThymeleafConfig.java b/tamguo-bms/src/main/java/com/tamguo/config/web/ThymeleafConfig.java index cb46b3f..7c7be0b 100644 --- a/tamguo-bms/src/main/java/com/tamguo/config/web/ThymeleafConfig.java +++ b/tamguo-bms/src/main/java/com/tamguo/config/web/ThymeleafConfig.java @@ -24,6 +24,7 @@ public class ThymeleafConfig implements EnvironmentAware{ vars.put("domainName", env.getProperty("domain.name")); vars.put("adminDomain", env.getProperty("admin.domain.name")); vars.put("memberDomain", env.getProperty("member.domain.name")); + vars.put("tamguoDomain", env.getProperty("tamguo.domain.name")); vars.put("PAPER_TYPE_ZHENTI", SystemConstant.ZHENGTI_PAPER_ID); vars.put("PAPER_TYPE_MONI", SystemConstant.MONI_PAPER_ID); vars.put("PAPER_TYPE_YATI", SystemConstant.YATI_PAPER_ID); diff --git a/tamguo-bms/src/main/java/com/tamguo/interceptor/MemberInterceptor.java b/tamguo-bms/src/main/java/com/tamguo/interceptor/MemberInterceptor.java index 0a1382d..c26a535 100644 --- a/tamguo-bms/src/main/java/com/tamguo/interceptor/MemberInterceptor.java +++ b/tamguo-bms/src/main/java/com/tamguo/interceptor/MemberInterceptor.java @@ -20,7 +20,7 @@ public class MemberInterceptor extends HandlerInterceptorAdapter{ /** 登录URL */ private String loginUrl = DEFAULT_LOGIN_URL; - @Value("${tamguo.admin.name}") + @Value("${tamguo.domain.name}") private String tamguoDomainName; /** diff --git a/tamguo-bms/src/main/resources/application.properties b/tamguo-bms/src/main/resources/application.properties index e79e229..42ce0b2 100644 --- a/tamguo-bms/src/main/resources/application.properties +++ b/tamguo-bms/src/main/resources/application.properties @@ -1,7 +1,7 @@ domain.name=https://book.tamguo.com/ admin.domain.name=https://admin.tamguo.com/ -tamguo.admin.name=https://www.tamguo.com/ -member.domain.name=https://member.tamguo.com/ +tamguo.domain.name=https://www.tamguo.com/ +member.domain.name=http://member.tamguo.com/ cookie.domian.name=tamguo.com server.port=8083 jasypt.encryptor.password=tamguo diff --git a/tamguo-bms/src/main/resources/static/images/avatar.png b/tamguo-bms/src/main/resources/static/images/avatar.png new file mode 100644 index 0000000..616985e Binary files /dev/null and b/tamguo-bms/src/main/resources/static/images/avatar.png differ diff --git a/tamguo-bms/src/main/resources/templates/index.html b/tamguo-bms/src/main/resources/templates/index.html index fa937ab..f9f56a7 100644 --- a/tamguo-bms/src/main/resources/templates/index.html +++ b/tamguo-bms/src/main/resources/templates/index.html @@ -42,17 +42,51 @@ diff --git a/tamguo-mms/src/main/java/com/tamguo/web/LoginController.java b/tamguo-mms/src/main/java/com/tamguo/web/LoginController.java index 54b699f..93f29a9 100644 --- a/tamguo-mms/src/main/java/com/tamguo/web/LoginController.java +++ b/tamguo-mms/src/main/java/com/tamguo/web/LoginController.java @@ -35,14 +35,15 @@ public class LoginController { } @RequestMapping(value = "/login.html", method = RequestMethod.GET) - public ModelAndView login(ModelAndView model){ + public ModelAndView login(String redirectUrl , ModelAndView model){ model.setViewName("login"); model.addObject("isVerifyCode" , "0"); + model.addObject("redirectUrl", redirectUrl); return model; } @RequestMapping(value = "/submitLogin.html", method = RequestMethod.POST) - public ModelAndView submitLogin(String username , String password , String verifyCode , ModelAndView model , HttpSession session , HttpServletResponse response) throws IOException{ + public ModelAndView submitLogin(String username , String password , String verifyCode , String redirectUrl , ModelAndView model , HttpSession session , HttpServletResponse response) throws IOException{ Result result = Result.successResult(null); if(StringUtils.isEmpty(verifyCode)) { result = Result.result(202, null, "请输入验证码"); @@ -57,7 +58,11 @@ public class LoginController { subject.login(token); session.setAttribute("currMember", ShiroUtils.getMember()); - response.sendRedirect("index.html"); + if(!StringUtils.isEmpty(redirectUrl)) { + response.sendRedirect(redirectUrl); + }else { + response.sendRedirect("index.html"); + } return null; } catch (UnknownAccountException e) { result = Result.result(201, null, "用户名或密码有误,请重新输入或找回密码"); diff --git a/tamguo-mms/src/main/resources/templates/login.html b/tamguo-mms/src/main/resources/templates/login.html index ad12a15..55e2611 100644 --- a/tamguo-mms/src/main/resources/templates/login.html +++ b/tamguo-mms/src/main/resources/templates/login.html @@ -31,6 +31,7 @@
+