• 大小: 50.86MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2022-05-25
  • 语言: 其他
  • 标签: ssm  

资源简介

ssm选课系统。一些增删改查,还有一些复杂的业务逻辑,大家可以参考一下,希望可以帮助到大家

资源截图

代码片段和文件信息

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  2018-02-19 17:16  SSM_Demo\
     目录           0  2018-03-02 21:20  SSM_Demo\.git\
     文件           5  2018-02-19 17:16  SSM_Demo\.git\COMMIT_EDITMSG
     文件         105  2018-02-19 17:15  SSM_Demo\.git\FETCH_HEAD
     文件          23  2018-02-19 17:13  SSM_Demo\.git\HEAD
     目录           0  2018-02-19 17:13  SSM_Demo\.git\branches\
     文件         214  2018-02-19 17:15  SSM_Demo\.git\config
     文件          73  2018-02-19 17:13  SSM_Demo\.git\description
     目录           0  2018-02-19 17:13  SSM_Demo\.git\hooks\
     文件         478  2018-02-19 17:13  SSM_Demo\.git\hooks\applypatch-msg.sample
     文件         896  2018-02-19 17:13  SSM_Demo\.git\hooks\commit-msg.sample
     文件         189  2018-02-19 17:13  SSM_Demo\.git\hooks\post-update.sample
     文件         424  2018-02-19 17:13  SSM_Demo\.git\hooks\pre-applypatch.sample
     文件        1642  2018-02-19 17:13  SSM_Demo\.git\hooks\pre-commit.sample
     文件        1348  2018-02-19 17:13  SSM_Demo\.git\hooks\pre-push.sample
     文件        4898  2018-02-19 17:13  SSM_Demo\.git\hooks\pre-rebase.sample
     文件         544  2018-02-19 17:13  SSM_Demo\.git\hooks\pre-receive.sample
     文件        1239  2018-02-19 17:13  SSM_Demo\.git\hooks\prepare-commit-msg.sample
     文件        3610  2018-02-19 17:13  SSM_Demo\.git\hooks\update.sample
     文件       62773  2018-02-22 18:10  SSM_Demo\.git\index
     目录           0  2018-02-19 17:13  SSM_Demo\.git\info\
     文件         240  2018-02-19 17:13  SSM_Demo\.git\info\exclude
     目录           0  2018-02-19 17:15  SSM_Demo\.git\logs\
     文件         282  2018-02-19 17:16  SSM_Demo\.git\logs\HEAD
     目录           0  2018-02-19 17:15  SSM_Demo\.git\logs\refs\
     目录           0  2018-02-19 17:15  SSM_Demo\.git\logs\refs\heads\
     文件         282  2018-02-19 17:16  SSM_Demo\.git\logs\refs\heads\master
     目录           0  2018-02-19 17:15  SSM_Demo\.git\logs\refs\remotes\
     目录           0  2018-02-19 17:15  SSM_Demo\.git\logs\refs\remotes\origin\
     文件         304  2018-02-19 17:17  SSM_Demo\.git\logs\refs\remotes\origin\master
     目录           0  2018-02-22 18:10  SSM_Demo\.git\objects\
............此处省略1281个文件信息

评论

共有 条评论