• 大小: 1.1MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-08-28
  • 语言: 其他
  • 标签: ssm  spring  

资源简介

ssm刚做的课设 第一名 A+的成绩 带数据库 还有报告呢

资源截图

代码片段和文件信息

package com.zxc.controller.common;

import com.zxc.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.SessionAttributes;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@Controller
@SessionAttributes({“username““teaid““stuid“})
public class LoginController {
    @Resource
    private UserService userService;

    @RequestMapping(“login“)
    public String login(){
        return “login“;
    }

    @RequestMapping(value = “check“method = RequestMethod.POST)
    public String checkAccount(@RequestParam(“userid“) int id@RequestParam(“userpass“) String passModel model) {
        if (userService.checkAccount(id pass) == 2) {
            model.addAttribute(“username“userService.getTeaNameById(id));
            model.addAttribute(“teaid“id);
            return “redirect:teacher/teacherIndex“;
        }
        else if(userService.checkAccount(id pass) == 1){
            model.addAttribute(“username“userService.getStuNameById(id));
            model.addAttribute(“stuid“id);
            return “redirect:student/studentIndex“;
        }
        else{
            model.addAttribute(“msg““密码错误“);
            //这里不加redirect,否则前端el取不到值
            return “login“;
        }
    }

    @RequestMapping(“exit“)
    public String exit(HttpServletRequest request){
        request.getSession().invalidate();
        return “login“;
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-01-02 13:29  CoursesSelPro\
     文件        1537  2019-01-02 13:29  CoursesSelPro\.classpath
     目录           0  2018-12-30 20:02  CoursesSelPro\.idea\
     目录           0  2019-01-02 20:43  CoursesSelPro\target\test-classes\com\zxc\test\
     目录           0  2018-12-30 18:59  CoursesSelPro\.idea\libraries\
     文件         782  2018-12-30 18:59  CoursesSelPro\.idea\libraries\commons_fileupload_1_3_3.xml
     文件         258  2018-12-30 18:59  CoursesSelPro\.idea\misc.xml
     文件         266  2018-12-30 18:59  CoursesSelPro\.idea\modules.xml
     文件       22612  2018-12-30 20:02  CoursesSelPro\.idea\workspace.xml
     文件        1638  2018-12-30 19:43  CoursesSelPro\.project
     目录           0  2018-12-30 18:24  CoursesSelPro\.settings\
     文件         639  2018-12-30 17:15  CoursesSelPro\.settings\.jsdtscope
     文件          78  2018-12-30 18:24  CoursesSelPro\.settings\com.genuitec.eclipse.migration.prefs
     文件         191  2018-12-30 17:20  CoursesSelPro\.settings\org.eclipse.core.resources.prefs
     文件         430  2018-12-30 17:15  CoursesSelPro\.settings\org.eclipse.jdt.core.prefs
     文件          90  2018-12-30 17:15  CoursesSelPro\.settings\org.eclipse.m2e.core.prefs
     文件         754  2019-01-02 13:29  CoursesSelPro\.settings\org.eclipse.wst.common.component
     文件         447  2018-12-30 19:08  CoursesSelPro\.settings\org.eclipse.wst.common.project.facet.core.prefs.xml
     文件         494  2018-12-30 19:08  CoursesSelPro\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2018-12-30 17:15  CoursesSelPro\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2018-12-30 17:15  CoursesSelPro\.settings\org.eclipse.wst.jsdt.ui.superType.name
     文件          50  2018-12-30 17:15  CoursesSelPro\.settings\org.eclipse.wst.validation.prefs
     文件        1485  2018-12-30 19:12  CoursesSelPro\CoursesSelPro.iml
     目录           0  2019-01-02 13:29  CoursesSelPro\bin\
     目录           0  2019-01-02 13:29  CoursesSelPro\bin\src\
     目录           0  2019-01-02 13:29  CoursesSelPro\bin\src\main\
     目录           0  2019-01-02 13:29  CoursesSelPro\bin\src\main\java\
     目录           0  2019-01-02 13:29  CoursesSelPro\bin\src\main\java\com\
     目录           0  2019-01-02 13:29  CoursesSelPro\bin\src\main\java\com\zxc\
     目录           0  2019-01-02 13:29  CoursesSelPro\bin\src\main\java\com\zxc\service\
     文件        1493  2019-01-02 13:29  CoursesSelPro\bin\src\main\java\com\zxc\service\UserService.class
............此处省略302个文件信息

评论

共有 条评论