[TOC]
涉及数据库
user
LoginTicket
Controller
register
1 | Map<String, Object> map = userService.register(user); |
login
1 | public String login(String username, String password, String code, boolean rememberme, |
1 | Map<String, Object> map = userService.login(username, password, expiredSeconds); |
kaptcha
1 | public void getKaptcha(HttpServletResponse response/*, HttpSession session*/) { |
验证码:
1 | if (StringUtils.isNotBlank(kaptchaOwner)) { |
Service
UserService
注册
1 | Map<String, Object> register(User user) |
1 | User u = userMapper.selectByName(user.getUsername()); |
1 | // 注册用户 |
登录
1 | Map<String, Object> login(String username, String password, long expiredSeconds) |
1 | // 验证账号 |
Mapper
拦截器
1 | AlphaInterceptor implements HandlerInterceptor |
1 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { |
1 | registry.addInterceptor(loginTicketInterceptor) |