src/com/cms/controller/LoginController.java
(开头部分) 4KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
package com.cms.controller;
import com.alibaba.fastjson.JSON;
import com.cms.entity.Auth;
import com.cms.entity.User;
import com.cms.service.*;
import com.cms.utils.StrUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import javax.imageio.ImageIO;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.awt.*;
import java.awt.font.FontRenderContext;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.List;
import java.util.Random;
@Controller
@RequestMapping(value="/login")
public class LoginController {
@Autowired
AuthService authService;
@Autowired
AdminService adminServiceImpl;
@Autowired
TeacherService teacherServiceImpl;
@Autowired
StudentService studentServiceImpl;
@RequestMapping(value="/loginPage")
public ModelAndView toLoginPage() {
return new ModelAndView("login");
}
@ResponseBody
@RequestMapping(value="/doLogin")
public String doLogin(@RequestParam(defaultValue="") String username,
@RequestParam(defaultValue="") String password,
@RequestParam(defaultValue="0") int userType,
@RequestParam(defaultValue="") String verifyCode, HttpSession session) {
//比较验证码
String sessionVerifyCode = (String) session.getAttribute(StrUtil.VERIFY_CODE);
if (sessionVerifyCode == null || !sessionVerifyCode.equals(verifyCode.toUpperCase()) ) {
return StrUtil.CODE_ERROR;
}
后面还有 91 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。