Commit 862ae7c0 by weisong

test redis and login

parent c5492616
......@@ -36,6 +36,7 @@ public class LoginInterceptor implements HandlerInterceptor {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
String token = request.getHeader("Authorization");
log.info("request uri :"+request.getRequestURI());
if (token == null || token.trim().isEmpty()) {
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
throw new BusinessException(HttpServletResponse.SC_UNAUTHORIZED, GlobalErrorCodeConstants.LOGIN_EXPIRED.getMsg());
......
......@@ -24,7 +24,9 @@ public class TheWebMvcConfigurer implements WebMvcConfigurer {
"/sys/**",
"/verify/**",
"/person/**",
"/text/**"
"/text/**",
"/error/**",
"/error"
);
registry.addInterceptor(webAuthInterceptor());
......
package com.cnooc.expert.controller.auth;
import com.cnooc.expert.auth.service.LoginService;
import com.cnooc.expert.auth.service.SysCaptchaService;
import com.cnooc.expert.common.response.ApiResult;
import com.cnooc.expert.auth.service.LoginService;
import com.cnooc.expert.system.entity.vo.LoginVO;
import com.cnooc.expert.system.entity.vo.SysCaptchaVO;
import com.cnooc.expert.system.entity.vo.VerifyCodeVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
......@@ -25,6 +24,7 @@ public class LoginController {
@Autowired
private SysCaptchaService sysCaptchaService;
/**
* 手机号验证码/身份证号密码 登录功能
* @param loginVO 登录表单
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment