package com.seventh.action.pub;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.apache.struts2.ServletActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.seventh.entity.Admin;
import com.seventh.entity.Config;
import com.seventh.entity.Field;
import com.seventh.entity.Notice;
import com.seventh.entity.Page;
import com.seventh.entity.Position;
import com.seventh.entity.Student;
import com.seventh.entity.Teacher;
import com.seventh.service.AdminService;
import com.seventh.service.ConfigService;
import com.seventh.service.FieldService;
import com.seventh.service.NoticeService;
import com.seventh.service.PositionService;
import com.seventh.service.StudentService;
import com.seventh.service.TeacherService;
import com.seventh.util.MD5Util;
import com.seventh.util.PageUtil;
@SuppressWarnings("serial")
public class LoginAction extends ActionSupport{
private String id;
private String password;
private String message;
private Page loginNoticePage;
private AdminService adminService;
private TeacherService teacherService;
private StudentService studentService;
private NoticeService noticeService;
private FieldService fieldService;
private PositionService positionService;
private ConfigService configService;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public Page getLoginNoticePage() {
return loginNoticePage;
}
public void setLoginNoticePage(Page loginNoticePage) {
this.loginNoticePage = loginNoticePage;
}
public AdminService getAdminService() {
return adminService;
}
public void setAdminService(AdminService adminService) {
this.adminService = adminService;
}
public TeacherService getTeacherService() {
return teacherService;
}
public void setTeacherService(TeacherService teacherService) {
this.teacherService = teacherService;
}
public StudentService getStudentService() {
return studentService;
}
public void setStudentService(StudentService studentService) {
this.studentService = studentService;
}
public NoticeService getNoticeService() {
return noticeService;
}
public void setNoticeService(NoticeService noticeService) {
this.noticeService = noticeService;
}
public FieldService getFieldService() {
return fieldService;
}
public void setFieldService(FieldService fieldService) {
this.fieldService = fieldService;
}
public PositionService getPositionService() {
return positionService;
}
public void setPositionService(PositionService positionService) {
this.positionService = positionService;
}
public ConfigService getConfigService() {
return configService;
}
public void setConfigService(ConfigService configService) {
this.configService = configService;
}
public String execute(){
HttpServletRequest request = ServletActionContext.getRequest();
HttpSession session = request.getSession();
session.removeAttribute("logintype");
session.removeAttribute("student");
session.removeAttribute("teacher");
session.removeAttribute("admin");
Config config=this.getConfigService().init();
Student studentLogin = studentService.findStudentById(getId());
if (studentLogin != null) {
if(studentLogin.getPassword().equals(MD5Util.md5(getPassword())))
{
int totalCount=this.noticeService.noticeCounts("0","0");
loginNoticePage=PageUtil.createPage(10, totalCount, 0);
List<Notice> notices=this.noticeService.queryByPage(loginNoticePage);
session.setAttribute("loginIndexnotices", notices);
session.setAttribute("loginNoticePage", loginNoticePage);
session.setAttribute("student", studentLogin);
session.setAttribute("logintype", "student");
session.setAttribute("config", config);
message="登录成功!";
return "stuLogin";
}
else
{
message="密码不正确,请认真核实。";
return INPUT;
}
}
else
{
Teacher teacherLogin = teacherService.findTeacherById(id);
if (teacherLogin != null) {
if(teacherLogin.getPassword().equals(MD5Util.md5(getPassword())))
{
int totalCount=this.noticeService.noticeCounts("0","0");
loginNoticePage=PageUtil.createPage(10, totalCount, 0);
List<Notice> notices=this.noticeService.queryByPage(loginNoticePage);
Position position=this.getPositionService().findPositionById(teacherLogin.getPositionId());
Field field=this.getFieldService().findFieldById(teacherLogin.getFieldId());
session.setAttribute("loginIndexnotices", notices);
session.setAttribute("loginNoticePage", loginNoticePage);
session.setAttribute("teacher", teacherLogin);
session.setAttribute("logintype", "teacher");
session.setAttribute("config", config);
session.setAttribute("position", position);
session.setAttribute("field", field);
message="登录成功!";
return "teaLogin";
}
else
{
message="密码不正确,请认真核实。";
return INPUT;
}
}
else
{
Admin adminLogin = adminService.findAdminById(id);
if(adminLogin!=null)
{
if(adminLogin.getPassword().equals(MD5Util.md5(getPassword())))
{
int totalCount=this.noticeService.noticeCounts("0","0");
loginNoticePage=PageUtil.createPage(10, totalCount, 0);
List<Notice> notices=this.noticeService.queryByPage(loginNoticePage);
session.setAttribute("loginIndexnotices", notices);
session.setAttribute("loginNoticePage", loginNoticePage);
session.setAttribute("admin", adminLogin);
session.setAttribute("logintype", "admin");
session.setAttribute("config", config);
message="登录成功!";
return "adminLogin";
}
else
{
message="密码不正确,请认真核实。";
return INPUT;
}
}
else{
message="没有此账号,请认真核实。";
return INPUT;
}
}
}
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
课设&大作业-毕业设计毕业论文选题系统的设计与实现.zip
共561个文件
png:121个
java:115个
js:77个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 56 浏览量
2024-04-27
20:08:42
上传
评论
收藏 20.25MB ZIP 举报
温馨提示
【资源说明】【毕业设计】 1、该资源内项目代码都是经过测试运行成功,功能正常的情况下才上传的,请放心下载使用。 2、适用人群:主要针对计算机相关专业(如计科、信息安全、数据科学与大数据技术、人工智能、通信、物联网、数学、电子信息等)的同学或企业员工下载使用,具有较高的学习借鉴价值。 3、不仅适合小白学习实战练习,也可作为大作业、课程设计、毕设项目、初期项目立项演示等,欢迎下载,互相学习,共同进步!
资源推荐
资源详情
资源评论
收起资源包目录
课设&大作业-毕业设计毕业论文选题系统的设计与实现.zip (561个子文件)
ueditor.css 43KB
ueditor.min.css 34KB
video-js.css 21KB
image.css 18KB
video.css 15KB
attachment.css 14KB
video-js.min.css 11KB
style.css 9KB
login.css 7KB
shCoreDefault.css 7KB
scrawl.css 4KB
codemirror.css 3KB
charts.css 3KB
background.css 2KB
emotion.css 2KB
dialogbase.css 2KB
music.css 2KB
edittable.css 1KB
template.css 1KB
webuploader.css 515B
reset.css 481B
help.css 389B
iframe.css 41B
vjs.eot 3KB
UEditorSnapscreen.exe 508KB
wface.gif 49KB
jxface2.gif 40KB
yface.gif 28KB
bface.gif 27KB
icons.gif 20KB
file-icons.gif 20KB
file-icons.gif 20KB
tface.gif 19KB
fface.gif 18KB
cface.gif 8KB
icons-all.gif 4KB
videologo.gif 2KB
cancelbutton.gif 1KB
button-bg.gif 1KB
lock.gif 1KB
alignicon.gif 1KB
word.gif 1019B
icon_doc.gif 1012B
icon_psd.gif 1009B
icon_rar.gif 1007B
icon_xls.gif 1005B
icon_ppt.gif 1001B
icon_mv.gif 1001B
icon_pdf.gif 996B
icon_mp3.gif 986B
icon_txt.gif 970B
icon_jpg.gif 950B
icon_exe.gif 949B
icon_chm.gif 923B
loading.gif 734B
icons.gif 453B
icons.gif 453B
icons.gif 453B
success.gif 445B
success.gif 445B
success.gif 445B
cursor_v.gif 370B
cursor_h.gif 253B
anchor.gif 184B
highlighted.gif 111B
unhighlighted.gif 111B
dot.gif 102B
bg.gif 84B
pagebreak.gif 54B
spacer.gif 43B
0.gif 43B
.gitignore 74B
wordimage.html 6KB
map.html 6KB
emotion.html 6KB
image.html 5KB
show.html 5KB
charts.html 5KB
link.html 4KB
insertframe.html 4KB
video.html 4KB
searchreplace.html 4KB
gmap.html 4KB
scrawl.html 4KB
background.html 3KB
help.html 3KB
edittable.html 2KB
webapp.html 2KB
attachment.html 2KB
snapscreen.html 2KB
anchor.html 2KB
edittd.html 2KB
preview.html 1KB
music.html 950B
template.html 922B
edittip.html 863B
spechars.html 829B
login.html 211B
hibernate3.jar 3.95MB
struts2-dojo-plugin-2.2.3.1.jar 1.65MB
共 561 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
zero2100
- 粉丝: 162
- 资源: 2464
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Panoply软件是大名鼎鼎的NASA下属的GISS研究所开发的可视化软件,该软件可以实现对地学常用数据的读取,其中包括netC
- 一些高质量的学习Ruby的资源清单.zip
- 基于STM32智能家居(智能云)
- 适合江苏地带的别墅小院子图纸D038-两层-11.04&11.94米-施工图.dwg
- 农村小别墅图纸四合院图纸D037-两层-13.20&12.90米-施工图.dwg
- 农村别墅系列图纸cad图纸D035-两层-10.20&14.70米- 施工图.dwg
- Verilog硬件仿真过程中出现的X态总结
- 中国各省份2012-2020年政府财政支出占GDP的比重
- 旅游管理系统毕业设计+计算机专业本科毕业设计+Vue+JS框架
- 农村小别墅二层小楼图纸D034-两层-11.40&14.70米- 施工图.dwg
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功