作者主页:源码空间站2022
简介:Java领域优质创作者、Java项目、学习资料、技术互助
文末获取源码
项目介绍
管理员角色包含以下功能:
管理员首页,管理员管理,用户管理,科室管理,专家管理,床位管理,留言管理,公告管理等功能
用户角色包含以下功能:
用户登录,科室专家查看,住院床位查看,预约记录查看,用户中心管理,留言板,用户登录注册等功能。
医生角色包含以下功能:
医生主页,就诊预约管理,住院预约管理,个人信息管理等功能。
由于本程序规模不大,可供课程设计,毕业设计学习演示之用
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可
4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
5.数据库:MySql 5.7版本;
6.是否Maven项目:否;
技术栈
1. 后端:mysql+Spring+hibernate+Struts 2
2. 前端:HTML+CSS+JavaScript+jsp
使用说明
1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行;
3. 将项目中application.yml配置文件中的数据库配置改为自己的配置;
4. 运行项目,输入localhost:8080/ 登录
运行截图
相关代码
登录管理控制器
@WebServlet("/autoLogin")
public class AutoLoginServlet extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
this.doGet(request, response);
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("utf8");
Cookie[] cookies = request.getCookies();
String username = null;
String ssid = null;
for (Cookie cookie : cookies){
if(cookie.getName().equals("userKey")){
username = cookie.getValue();
}
if(cookie.getName().equals("ssid")){
ssid = cookie.getValue();
}
}
if(username != null && ssid != null && ssid.equals(CookieUtils.md5Encrypt(username))){
UserService userService = new UserServiceImpl();
User user = userService.getUserForPhone(username);
HttpSession session = request.getSession();
session.setAttribute("user",user);
// response.sendRedirect("index.jsp");
}/*else {
// response.sendRedirect("index.jsp");
}*/
}
}
如果也想学习本系统,下面领取。关注并回复:036ssh