【SSM项目实战讲解】汽车租赁管理系统项目功能演示与课程说明

【SSM项目实战讲解】汽车租赁管理系统项目功能演示与课程说明

配置模板页面

<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%     String basePath = request.getScheme() + "://"             + request.getServerName() + ":" +             request.getServerPort() + request.getContextPath() + "/"; %> <html> <head>     <title>管理员登录页面</title>     <link rel="stylesheet" href="<%=basePath%>layui/css/layui.css"/>     <script type="text/javascript" src="<%=basePath%>js/jquery.js"></script>     <script type="text/javascript" src="<%=basePath%>layui/layui.js"></script> </head> <body> <div> </div> </body> 

``
******在 shiro课程讲解中有完整的讲解过 Realm的定义****

```javascript
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authenticationToken) throws AuthenticationException {     log.info("========登录授权认证========");     // 1 、取得用户名     String username = (String) authenticationToken.getPrincipal();     try {         Admin vo = this.adminServiceBack.login(username);         if (vo == null) {             throw new UnknownAccountException("用户不存在!");         } else {             // 2 、取得登录密码             String password = (new String((char[]) authenticationToken.getCredentials()));             if (vo.getPassword().equals(password)) {                 AuthenticationInfo auth = new SimpleAuthenticationInfo(username, password, "adminRealm");                 return auth;             } else {                 throw new IncorrectCredentialsException("密码错误!"); 

**课程问题答疑:**

在这里插入图片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章