mirror of
https://gitee.com/gz-yami/mall4j.git
synced 2026-03-22 09:17:16 +08:00
最低版本要求jdk17, 升级spring boot3.0
This commit is contained in:
@@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
/**
|
||||
* @author 菠萝凤梨
|
||||
|
||||
@@ -23,7 +23,7 @@ public class MallWebSecurityConfigurerAdapter {
|
||||
.and().sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
|
||||
.and().authorizeRequests().requestMatchers(CorsUtils::isPreFlightRequest).permitAll()
|
||||
.and()
|
||||
.authorizeRequests().antMatchers(
|
||||
.authorizeRequests().requestMatchers(
|
||||
"/**").permitAll().and().build();
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
|
||||
|
||||
import javax.servlet.DispatcherType;
|
||||
import jakarta.servlet.DispatcherType;
|
||||
|
||||
/**
|
||||
* 授权配置
|
||||
|
||||
@@ -18,7 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @author 菠萝凤梨
|
||||
|
||||
@@ -15,13 +15,13 @@ import com.yami.shop.security.common.dto.RefreshTokenDTO;
|
||||
import com.yami.shop.security.common.manager.TokenStore;
|
||||
import com.yami.shop.security.common.vo.TokenInfoVO;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import ma.glasnost.orika.MapperFacade;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
/**
|
||||
* @author 菠萝凤梨
|
||||
@@ -34,15 +34,13 @@ public class TokenController {
|
||||
@Autowired
|
||||
private TokenStore tokenStore;
|
||||
|
||||
@Autowired
|
||||
private MapperFacade mapperFacade;
|
||||
|
||||
@PostMapping("/token/refresh")
|
||||
public ServerResponseEntity<TokenInfoVO> refreshToken(@Valid @RequestBody RefreshTokenDTO refreshTokenDTO) {
|
||||
TokenInfoBO tokenInfoServerResponseEntity = tokenStore
|
||||
.refreshToken(refreshTokenDTO.getRefreshToken());
|
||||
return ServerResponseEntity
|
||||
.success(mapperFacade.map(tokenInfoServerResponseEntity, TokenInfoVO.class));
|
||||
.success(BeanUtil.copyProperties(tokenInfoServerResponseEntity, TokenInfoVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ package com.yami.shop.security.common.dto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* 用于登陆传递账号密码
|
||||
|
||||
@@ -11,7 +11,7 @@ package com.yami.shop.security.common.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* 刷新token
|
||||
|
||||
@@ -25,9 +25,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.AntPathMatcher;
|
||||
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.*;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user