解决小程序图片打包过大,放置后端,不引用ngnix、minio等组件,还能进行权限校验
package com.huida.web.controller.common.app;
import com.huida.common.core.controller.BaseController;
import com.huida.common.utils.file.FileUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@RestController
@RequiredArgsConstructor
@RequestMapping("/static")