feat(修改): 无法导出Excel

Signed-off-by: bunny <1319900154@qq.com>
This commit is contained in:
bunny 2024-03-26 13:08:01 +08:00
parent 6de6b4d232
commit d45eac0623
4 changed files with 5 additions and 3 deletions

View File

@ -38,7 +38,7 @@ public class WebMvcConfiguration extends WebMvcConfigurationSupport {
protected void addInterceptors(InterceptorRegistry registry) { protected void addInterceptors(InterceptorRegistry registry) {
log.info("WebMvcConfiguration===>开始注册自定义拦截器..."); log.info("WebMvcConfiguration===>开始注册自定义拦截器...");
// 需要拦截的 // 需要拦截的
registry.addInterceptor(loginAuthInterceptor).addPathPatterns("/**") registry.addInterceptor(loginAuthInterceptor).addPathPatterns("/admin")
.excludePathPatterns(interceptorsProperties.getNoAuthUrls()); .excludePathPatterns(interceptorsProperties.getNoAuthUrls());
} }
} }

View File

@ -6,12 +6,14 @@ import com.atguigu.spzx.model.entity.product.CategoryBrand;
import com.atguigu.spzx.model.vo.result.Result; import com.atguigu.spzx.model.vo.result.Result;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@Tag(name = "分类品牌")
@RestController @RestController
@RequestMapping(value = "/admin/product/categoryBrand") @RequestMapping(value = "/admin/product/categoryBrand")
public class CategoryBrandController { public class CategoryBrandController {

View File

@ -72,7 +72,7 @@ public class CategoryServiceImpl implements CategoryService {
}); });
try { try {
// 入文件 // 出数据到浏览器端
EasyExcel.write(response.getOutputStream(), CategoryExcelVo.class).sheet("分类数据").doWrite(excelVoArrayList); EasyExcel.write(response.getOutputStream(), CategoryExcelVo.class).sheet("分类数据").doWrite(excelVoArrayList);
} catch (IOException exception) { } catch (IOException exception) {
log.error("文件写入失败:{}", exception.getMessage()); log.error("文件写入失败:{}", exception.getMessage());

View File

@ -20,4 +20,4 @@ bunny:
noAuthUrls: noAuthUrls:
- /admin/system/index/login - /admin/system/index/login
- /admin/system/index/generateValidateCode - /admin/system/index/generateValidateCode
- /v3/**