Commit 862ae7c0 by weisong

test redis and login

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