全局配置保持和其他应用命名相同
This commit is contained in:
@ -10,7 +10,7 @@ import org.springframework.stereotype.Component;
|
||||
*/
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "ruoyi")
|
||||
public class Global
|
||||
public class RuoYiConfig
|
||||
{
|
||||
/** 项目名称 */
|
||||
private static String name;
|
||||
@ -37,7 +37,7 @@ public class Global
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
Global.name = name;
|
||||
RuoYiConfig.name = name;
|
||||
}
|
||||
|
||||
public static String getVersion()
|
||||
@ -47,7 +47,7 @@ public class Global
|
||||
|
||||
public void setVersion(String version)
|
||||
{
|
||||
Global.version = version;
|
||||
RuoYiConfig.version = version;
|
||||
}
|
||||
|
||||
public static String getCopyrightYear()
|
||||
@ -57,7 +57,7 @@ public class Global
|
||||
|
||||
public void setCopyrightYear(String copyrightYear)
|
||||
{
|
||||
Global.copyrightYear = copyrightYear;
|
||||
RuoYiConfig.copyrightYear = copyrightYear;
|
||||
}
|
||||
|
||||
public static boolean isDemoEnabled()
|
||||
@ -67,7 +67,7 @@ public class Global
|
||||
|
||||
public void setDemoEnabled(boolean demoEnabled)
|
||||
{
|
||||
Global.demoEnabled = demoEnabled;
|
||||
RuoYiConfig.demoEnabled = demoEnabled;
|
||||
}
|
||||
|
||||
public static String getProfile()
|
||||
@ -77,7 +77,7 @@ public class Global
|
||||
|
||||
public void setProfile(String profile)
|
||||
{
|
||||
Global.profile = profile;
|
||||
RuoYiConfig.profile = profile;
|
||||
}
|
||||
|
||||
public static boolean isAddressEnabled()
|
||||
@ -87,7 +87,7 @@ public class Global
|
||||
|
||||
public void setAddressEnabled(boolean addressEnabled)
|
||||
{
|
||||
Global.addressEnabled = addressEnabled;
|
||||
RuoYiConfig.addressEnabled = addressEnabled;
|
||||
}
|
||||
|
||||
/**
|
@ -3,7 +3,7 @@ package com.ruoyi.common.utils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ruoyi.common.config.Global;
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.utils.http.HttpUtils;
|
||||
|
||||
@ -30,7 +30,7 @@ public class AddressUtils
|
||||
{
|
||||
return "内网IP";
|
||||
}
|
||||
if (Global.isAddressEnabled())
|
||||
if (RuoYiConfig.isAddressEnabled())
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -4,7 +4,7 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.ruoyi.common.config.Global;
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.exception.file.FileNameLengthLimitExceededException;
|
||||
import com.ruoyi.common.exception.file.FileSizeLimitExceededException;
|
||||
@ -33,7 +33,7 @@ public class FileUploadUtils
|
||||
/**
|
||||
* 默认上传的地址
|
||||
*/
|
||||
private static String defaultBaseDir = Global.getProfile();
|
||||
private static String defaultBaseDir = RuoYiConfig.getProfile();
|
||||
|
||||
public static void setDefaultBaseDir(String defaultBaseDir)
|
||||
{
|
||||
@ -143,7 +143,7 @@ public class FileUploadUtils
|
||||
|
||||
private static final String getPathFileName(String uploadDir, String fileName) throws IOException
|
||||
{
|
||||
int dirLastIndex = Global.getProfile().length() + 1;
|
||||
int dirLastIndex = RuoYiConfig.getProfile().length() + 1;
|
||||
String currentDir = StringUtils.substring(uploadDir, dirLastIndex);
|
||||
String pathFileName = Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName;
|
||||
return pathFileName;
|
||||
|
@ -45,7 +45,7 @@ import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||
import com.ruoyi.common.annotation.Excel.Type;
|
||||
import com.ruoyi.common.annotation.Excels;
|
||||
import com.ruoyi.common.config.Global;
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.exception.BusinessException;
|
||||
@ -824,7 +824,7 @@ public class ExcelUtil<T>
|
||||
*/
|
||||
public String getAbsoluteFile(String filename)
|
||||
{
|
||||
String downloadPath = Global.getDownloadPath() + filename;
|
||||
String downloadPath = RuoYiConfig.getDownloadPath() + filename;
|
||||
File desc = new File(downloadPath);
|
||||
if (!desc.getParentFile().exists())
|
||||
{
|
||||
|
Reference in New Issue
Block a user