提交代码
This commit is contained in:
@@ -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())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user