提交代码
This commit is contained in:
@@ -12,19 +12,8 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
||||
public class SolutionApplication
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
// System.setProperty("spring.devtools.restart.enabled", "false");
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SolutionApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 方案自动化生成启动成功 ლ(´ڡ`ლ)゙ \n" +
|
||||
" .-------. ____ __ \n" +
|
||||
" | _ _ \\ \\ \\ / / \n" +
|
||||
" | ( ' ) | \\ _. / ' \n" +
|
||||
" |(_ o _) / _( )_ .' \n" +
|
||||
" | (_,_).' __ ___(_ o _)' \n" +
|
||||
" | |\\ \\ | || |(_,_)' \n" +
|
||||
" | | \\ `' /| `-' / \n" +
|
||||
" | | \\ / \\ / \n" +
|
||||
" ''-' `'-' `-..-' ");
|
||||
System.out.println("方案自动化生成启动成功");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.springframework.util.FastByteArrayOutputStream;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.google.code.kaptcha.Producer;
|
||||
import com.solution.common.config.RuoYiConfig;
|
||||
import com.solution.common.config.SoluTionConfig;
|
||||
import com.solution.common.constant.CacheConstants;
|
||||
import com.solution.common.constant.Constants;
|
||||
import com.solution.common.core.domain.AjaxResult;
|
||||
@@ -61,7 +61,7 @@ public class CaptchaController
|
||||
BufferedImage image = null;
|
||||
|
||||
// 生成验证码
|
||||
String captchaType = RuoYiConfig.getCaptchaType();
|
||||
String captchaType = SoluTionConfig.getCaptchaType();
|
||||
if ("math".equals(captchaType))
|
||||
{
|
||||
String capText = captchaProducerMath.createText();
|
||||
|
||||
@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.solution.common.config.RuoYiConfig;
|
||||
import com.solution.common.config.SoluTionConfig;
|
||||
import com.solution.common.core.domain.AjaxResult;
|
||||
import com.solution.common.utils.StringUtils;
|
||||
import com.solution.common.utils.file.FileUploadUtils;
|
||||
@@ -52,7 +52,7 @@ public class CommonController
|
||||
throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
|
||||
}
|
||||
String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
|
||||
String filePath = RuoYiConfig.getDownloadPath() + fileName;
|
||||
String filePath = SoluTionConfig.getDownloadPath() + fileName;
|
||||
|
||||
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
||||
FileUtils.setAttachmentResponseHeader(response, realFileName);
|
||||
@@ -77,7 +77,7 @@ public class CommonController
|
||||
try
|
||||
{
|
||||
// 上传文件路径
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
String filePath = SoluTionConfig.getUploadPath();
|
||||
// 上传并返回新文件名称
|
||||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
String url = serverConfig.getUrl() + fileName;
|
||||
@@ -103,7 +103,7 @@ public class CommonController
|
||||
try
|
||||
{
|
||||
// 上传文件路径
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
String filePath = SoluTionConfig.getUploadPath();
|
||||
List<String> urls = new ArrayList<String>();
|
||||
List<String> fileNames = new ArrayList<String>();
|
||||
List<String> newFileNames = new ArrayList<String>();
|
||||
@@ -145,7 +145,7 @@ public class CommonController
|
||||
throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource));
|
||||
}
|
||||
// 本地资源路径
|
||||
String localPath = RuoYiConfig.getProfile();
|
||||
String localPath = SoluTionConfig.getProfile();
|
||||
// 数据库资源地址
|
||||
String downloadPath = localPath + FileUtils.stripPrefix(resource);
|
||||
// 下载名称
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.solution.web.controller.system;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.solution.common.config.RuoYiConfig;
|
||||
import com.solution.common.config.SoluTionConfig;
|
||||
import com.solution.common.utils.StringUtils;
|
||||
|
||||
/**
|
||||
@@ -16,7 +16,7 @@ public class SysIndexController
|
||||
{
|
||||
/** 系统基础配置 */
|
||||
@Autowired
|
||||
private RuoYiConfig ruoyiConfig;
|
||||
private SoluTionConfig ruoyiConfig;
|
||||
|
||||
/**
|
||||
* 访问首页,提示语
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.solution.common.annotation.Log;
|
||||
import com.solution.common.config.RuoYiConfig;
|
||||
import com.solution.common.config.SoluTionConfig;
|
||||
import com.solution.common.core.controller.BaseController;
|
||||
import com.solution.common.core.domain.AjaxResult;
|
||||
import com.solution.common.core.domain.entity.SysUser;
|
||||
@@ -128,13 +128,13 @@ public class SysProfileController extends BaseController
|
||||
if (!file.isEmpty())
|
||||
{
|
||||
LoginUser loginUser = getLoginUser();
|
||||
String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION, true);
|
||||
String avatar = FileUploadUtils.upload(SoluTionConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION, true);
|
||||
if (userService.updateUserAvatar(loginUser.getUserId(), avatar))
|
||||
{
|
||||
String oldAvatar = loginUser.getUser().getAvatar();
|
||||
if (StringUtils.isNotEmpty(oldAvatar))
|
||||
{
|
||||
FileUtils.deleteFile(RuoYiConfig.getProfile() + FileUtils.stripPrefix(oldAvatar));
|
||||
FileUtils.deleteFile(SoluTionConfig.getProfile() + FileUtils.stripPrefix(oldAvatar));
|
||||
}
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("imgUrl", avatar);
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import com.solution.common.config.RuoYiConfig;
|
||||
import com.solution.common.config.SoluTionConfig;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.models.auth.In;
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
@@ -32,7 +32,7 @@ public class SwaggerConfig
|
||||
{
|
||||
/** 系统基础配置 */
|
||||
@Autowired
|
||||
private RuoYiConfig ruoyiConfig;
|
||||
private SoluTionConfig ruoyiConfig;
|
||||
|
||||
/** 是否开启swagger */
|
||||
@Value("${swagger.enabled}")
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# 项目相关配置
|
||||
solution:
|
||||
# 名称
|
||||
name: solution
|
||||
# 版本
|
||||
version: 3.9.1
|
||||
# 版权年份
|
||||
copyrightYear: 2026
|
||||
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
||||
profile: D:/tools/uploadPath
|
||||
# 获取ip地址开关
|
||||
addressEnabled: false
|
||||
# 验证码类型 math 数字计算 char 字符验证
|
||||
captchaType: math
|
||||
# 开发环境配置
|
||||
server:
|
||||
# 服务器的HTTP端口,默认为8080
|
||||
|
||||
@@ -6,11 +6,11 @@ import org.springframework.stereotype.Component;
|
||||
/**
|
||||
* 读取项目相关配置
|
||||
*
|
||||
* @author ruoyi
|
||||
* @author zouju
|
||||
*/
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "ruoyi")
|
||||
public class RuoYiConfig
|
||||
@ConfigurationProperties(prefix = "solution")
|
||||
public class SoluTionConfig
|
||||
{
|
||||
/** 项目名称 */
|
||||
private String name;
|
||||
@@ -67,7 +67,7 @@ public class RuoYiConfig
|
||||
|
||||
public void setProfile(String profile)
|
||||
{
|
||||
RuoYiConfig.profile = profile;
|
||||
SoluTionConfig.profile = profile;
|
||||
}
|
||||
|
||||
public static boolean isAddressEnabled()
|
||||
@@ -77,7 +77,7 @@ public class RuoYiConfig
|
||||
|
||||
public void setAddressEnabled(boolean addressEnabled)
|
||||
{
|
||||
RuoYiConfig.addressEnabled = addressEnabled;
|
||||
SoluTionConfig.addressEnabled = addressEnabled;
|
||||
}
|
||||
|
||||
public static String getCaptchaType() {
|
||||
@@ -85,7 +85,7 @@ public class RuoYiConfig
|
||||
}
|
||||
|
||||
public void setCaptchaType(String captchaType) {
|
||||
RuoYiConfig.captchaType = captchaType;
|
||||
SoluTionConfig.captchaType = captchaType;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -6,7 +6,7 @@ import java.nio.file.Paths;
|
||||
import java.util.Objects;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.solution.common.config.RuoYiConfig;
|
||||
import com.solution.common.config.SoluTionConfig;
|
||||
import com.solution.common.constant.Constants;
|
||||
import com.solution.common.exception.file.FileNameLengthLimitExceededException;
|
||||
import com.solution.common.exception.file.FileSizeLimitExceededException;
|
||||
@@ -36,7 +36,7 @@ public class FileUploadUtils
|
||||
/**
|
||||
* 默认上传的地址
|
||||
*/
|
||||
private static String defaultBaseDir = RuoYiConfig.getProfile();
|
||||
private static String defaultBaseDir = SoluTionConfig.getProfile();
|
||||
|
||||
public static void setDefaultBaseDir(String defaultBaseDir)
|
||||
{
|
||||
@@ -170,7 +170,7 @@ public class FileUploadUtils
|
||||
|
||||
public static final String getPathFileName(String uploadDir, String fileName) throws IOException
|
||||
{
|
||||
int dirLastIndex = RuoYiConfig.getProfile().length() + 1;
|
||||
int dirLastIndex = SoluTionConfig.getProfile().length() + 1;
|
||||
String currentDir = StringUtils.substring(uploadDir, dirLastIndex);
|
||||
return Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import com.solution.common.config.RuoYiConfig;
|
||||
import com.solution.common.config.SoluTionConfig;
|
||||
import com.solution.common.constant.Constants;
|
||||
import com.solution.common.utils.DateUtils;
|
||||
import com.solution.common.utils.StringUtils;
|
||||
@@ -74,7 +74,7 @@ public class FileUtils
|
||||
*/
|
||||
public static String writeImportBytes(byte[] data) throws IOException
|
||||
{
|
||||
return writeBytes(data, RuoYiConfig.getImportPath());
|
||||
return writeBytes(data, SoluTionConfig.getImportPath());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.Arrays;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import com.solution.common.config.RuoYiConfig;
|
||||
import com.solution.common.config.SoluTionConfig;
|
||||
import com.solution.common.constant.Constants;
|
||||
import com.solution.common.utils.StringUtils;
|
||||
|
||||
@@ -79,7 +79,7 @@ public class ImageUtils
|
||||
else
|
||||
{
|
||||
// 本机地址
|
||||
String localPath = RuoYiConfig.getProfile();
|
||||
String localPath = SoluTionConfig.getProfile();
|
||||
String downloadPath = localPath + StringUtils.substringAfter(url, Constants.RESOURCE_PREFIX);
|
||||
in = new FileInputStream(downloadPath);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.solution.common.config.RuoYiConfig;
|
||||
import com.solution.common.config.SoluTionConfig;
|
||||
import com.solution.common.constant.Constants;
|
||||
import com.solution.common.utils.StringUtils;
|
||||
import com.solution.common.utils.http.HttpUtils;
|
||||
@@ -31,7 +31,7 @@ public class AddressUtils
|
||||
{
|
||||
return "内网IP";
|
||||
}
|
||||
if (RuoYiConfig.isAddressEnabled())
|
||||
if (SoluTionConfig.isAddressEnabled())
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -74,7 +74,7 @@ import com.solution.common.annotation.Excel;
|
||||
import com.solution.common.annotation.Excel.ColumnType;
|
||||
import com.solution.common.annotation.Excel.Type;
|
||||
import com.solution.common.annotation.Excels;
|
||||
import com.solution.common.config.RuoYiConfig;
|
||||
import com.solution.common.config.SoluTionConfig;
|
||||
import com.solution.common.core.domain.AjaxResult;
|
||||
import com.solution.common.core.text.Convert;
|
||||
import com.solution.common.exception.UtilException;
|
||||
@@ -1497,7 +1497,7 @@ public class ExcelUtil<T>
|
||||
*/
|
||||
public String getAbsoluteFile(String filename)
|
||||
{
|
||||
String downloadPath = RuoYiConfig.getDownloadPath() + filename;
|
||||
String downloadPath = SoluTionConfig.getDownloadPath() + filename;
|
||||
File desc = new File(downloadPath);
|
||||
if (!desc.getParentFile().exists())
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.springframework.web.filter.CorsFilter;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
import com.solution.common.config.RuoYiConfig;
|
||||
import com.solution.common.config.SoluTionConfig;
|
||||
import com.solution.common.constant.Constants;
|
||||
import com.solution.framework.interceptor.RepeatSubmitInterceptor;
|
||||
|
||||
@@ -31,7 +31,7 @@ public class ResourcesConfig implements WebMvcConfigurer
|
||||
{
|
||||
/** 本地文件上传路径 */
|
||||
registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**")
|
||||
.addResourceLocations("file:" + RuoYiConfig.getProfile() + "/");
|
||||
.addResourceLocations("file:" + SoluTionConfig.getProfile() + "/");
|
||||
|
||||
/** swagger配置 */
|
||||
registry.addResourceHandler("/swagger-ui/**")
|
||||
|
||||
@@ -63,7 +63,7 @@ public class SysLoginService
|
||||
public String login(String username, String password, String code, String uuid)
|
||||
{
|
||||
// 验证码校验
|
||||
// validateCaptcha(username, code, uuid);
|
||||
validateCaptcha(username, code, uuid);
|
||||
// 登录前置校验
|
||||
loginPreCheck(username, password);
|
||||
// 用户验证
|
||||
|
||||
Reference in New Issue
Block a user