main
tamguo 7 years ago
parent a5e07c777e
commit 95841b0ad4

@ -2,7 +2,6 @@ package com.tamguo.config.shiro;
import java.util.LinkedHashMap;
import java.util.Map;
import org.apache.shiro.cache.ehcache.EhCacheManager;
import org.apache.shiro.spring.LifecycleBeanPostProcessor;
import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor;
@ -93,4 +92,5 @@ public class ShiroConfiguration {
shiroFilterFactoryBean.setFilterChainDefinitionMap(filterChainDefinitionMap);
return shiroFilterFactoryBean;
}
}

@ -1,8 +1,9 @@
package com.tamguo.modules.sys.web;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.IncorrectCredentialsException;
import org.apache.shiro.authc.LockedAccountException;
@ -24,17 +25,17 @@ import com.tamguo.modules.sys.utils.TamguoConstant;
@Controller
public class LoginController {
@RequestMapping(path="sysLogin")
@RequestMapping(path="login")
public String sysLogin(ModelAndView model) {
if(ShiroUtils.isLogin()) {
return "sysIndex";
return "index";
}
return "sysLogin";
return "login";
}
@ResponseBody
@RequestMapping(value = "sysLogin", method = RequestMethod.POST)
public Result toLogin(HttpServletRequest request, String username, String password, String validCode)
@RequestMapping(value = "login", method = RequestMethod.POST)
public Result toLogin(HttpServletRequest request, HttpServletResponse response , String username , Boolean rememberUser, String password, String validCode)
throws IOException {
try {
String kaptcha = ShiroUtils.getKaptcha(TamguoConstant.KAPTCHA_SESSION_KEY);

@ -0,0 +1,19 @@
package com.tamguo.modules.sys.web;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import com.tamguo.modules.sys.utils.ShiroUtils;
@Controller
public class LogoutController {
@RequestMapping(path="logout")
public ModelAndView logout(ModelAndView model) {
ShiroUtils.logout();
model.setViewName("login");
return model;
}
}

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html>
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<meta content="webkit" name="renderer" />
@ -55,7 +55,7 @@
<script src="common/jeesite.js?V4.0-07200941"></script>
<script src="common/i18n/jeesite_zh_CN.js?V4.0-07200941"></script>
<script src="common/common.js?V4.0-07200941"></script>
<div class="hide" id="desktopTabPage" data-title="仪表盘" th:attr="data-url=${setting.domain + 'sys/desktop'}"></div>
<div class="hide" id="desktopTabPage" data-title="仪表盘" th:attr="data-url='sys/desktop'"></div>
<div class="hide" id="modifyPasswordTip" data-message=""></div>
<script src="jquery-toastr/2.0/toastr.min.js?V4.0-07200941"></script>
<script src="jquery-plugins/jquery.slimscroll.js"></script>

@ -33,7 +33,7 @@
<a th:href="${setting.domain}"><b>TamGuo OMS</b> <small th:text="${setting.version}">1.0.0</small></a>
</div>
<div class="login-box-body">
<form id="loginForm" th:action="${setting.domain + 'sysLogin'}" method="post">
<form id="loginForm" th:action="${setting.domain + 'login'}" method="post">
<div class="form-group has-feedback">
<span class="glyphicon glyphicon-user form-control-feedback"
title="登录账号"></span> <input type="text" id="username"
@ -84,11 +84,9 @@
<div class="form-group">
<div class="mt5 icheck">
<label title="公共场所慎用,下次不需要再填写帐号"><input type="checkbox"
name="rememberUserCode" class="form-control"
name="rememberUser" class="form-control" checked
data-style="square-blue"> 记住账号</label> &nbsp; <label
title="公共场所慎用,下次不需要再填写帐号和密码"><input type="checkbox"
name="rememberMe" class="form-control" data-style="square-blue">
记住密码</label>
title="公共场所慎用,下次不需要再填写帐号和密码">
</div>
</div>
<div class="form-group">

@ -52,8 +52,8 @@ content="width=device-width, initial-scale=1, user-scalable=1" name="viewport"/>
<label class="control-label col-sm-4">上级菜单:</label>
<div class="col-sm-8">
<div class="input-group treeselect" id="parentDiv" data-url="sys/menu/treeData?excludeCode=1019065460393922560&sysCode=default&isShowNameOrig=true">
<input id="parentCode" type="hidden" name="parentCode" th:value="${parentMenu.menuCode}" class="isReset"/>
<input id="parentName" type="text" name="parentName" th:value="${parentMenu.menuName}" class="form-control" readonly="readonly"/>
<input id="parentCode" type="hidden" name="parentCode" th:value="${parentMenu == null} ? '' : ${parentMenu.menuCode}" class="isReset"/>
<input id="parentName" type="text" name="parentName" th:value="${parentMenu == null} ? '' : ${parentMenu.menuName}" class="form-control" readonly="readonly"/>
<span class="input-group-btn"><a id="parentButton" href="javascript:"
class="btn btn-default "><i class="fa fa-search"></i></a>
</span>

@ -35,8 +35,8 @@ content="width=device-width, initial-scale=1, user-scalable=1" name="viewport"/>
<label class="control-label col-sm-4">上级机构:</label>
<div class="col-sm-8">
<div class="input-group treeselect" id="parentDiv" data-url="sys/office/treeData?excludeCode=SDJN">
<input id="parentCode" type="hidden" name="parentCode" th:value="${parentOffice.officeCode}" class="isReset"/>
<input id="parentName" type="text" name="parentName" th:value="${parentOffice.officeName}"
<input id="parentCode" type="hidden" name="parentCode" th:value="${parentOffice == null} ? '' : ${parentOffice.officeCode}" class="isReset"/>
<input id="parentName" type="text" name="parentName" th:value="${parentOffice == null} ? '' : ${parentOffice..officeName}"
class="form-control " readonly="readonly"/><span class="input-group-btn"><a id="parentButton" href="javascript:"
class="btn btn-default "><i class="fa fa-search"></i></a>
</span>

Loading…
Cancel
Save