更新框架
This commit is contained in:
24
ry.bat
24
ry.bat
@@ -1,21 +1,21 @@
|
|||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
rem jarƽ<72><C6BD>Ŀ¼
|
rem jarƽ<72><C6BD>Ŀ¼
|
||||||
set AppName=ruoyi.jar
|
set AppName=worn.jar
|
||||||
|
|
||||||
rem JVM<56><4D><EFBFBD><EFBFBD>
|
rem JVM<56><4D><EFBFBD><EFBFBD>
|
||||||
set JVM_OPTS="-Dname=%AppName% -Duser.timezone=Asia/Shanghai -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC"
|
set JVM_OPTS="-Dname=%AppName% -Duser.timezone=Asia/Shanghai -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC"
|
||||||
|
|
||||||
|
|
||||||
ECHO.
|
ECHO.
|
||||||
ECHO. [1] <20><><EFBFBD><EFBFBD>%AppName%
|
ECHO. [1] <20><><EFBFBD><EFBFBD>%AppName%
|
||||||
ECHO. [2] <20>ر<EFBFBD>%AppName%
|
ECHO. [2] <20>ر<EFBFBD>%AppName%
|
||||||
ECHO. [3] <20><><EFBFBD><EFBFBD>%AppName%
|
ECHO. [3] <20><><EFBFBD><EFBFBD>%AppName%
|
||||||
ECHO. [4] <20><><EFBFBD><EFBFBD>״̬ %AppName%
|
ECHO. [4] <20><><EFBFBD><EFBFBD>״̬ %AppName%
|
||||||
ECHO. [5] <20><> <20><>
|
ECHO. [5] <20><> <20><>
|
||||||
ECHO.
|
ECHO.
|
||||||
|
|
||||||
ECHO.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
ECHO.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD>:
|
||||||
set /p ID=
|
set /p ID=
|
||||||
IF "%id%"=="1" GOTO start
|
IF "%id%"=="1" GOTO start
|
||||||
IF "%id%"=="2" GOTO stop
|
IF "%id%"=="2" GOTO stop
|
||||||
@@ -35,11 +35,11 @@ PAUSE
|
|||||||
|
|
||||||
start javaw %JVM_OPTS% -jar %AppName%
|
start javaw %JVM_OPTS% -jar %AppName%
|
||||||
|
|
||||||
echo starting<6E><67><EFBFBD><EFBFBD>
|
echo starting<6E><67><EFBFBD><EFBFBD>
|
||||||
echo Start %AppName% success...
|
echo Start %AppName% success...
|
||||||
goto:eof
|
goto:eof
|
||||||
|
|
||||||
rem <20><><EFBFBD><EFBFBD>stopͨ<70><CDA8>jps<70><73><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>pid<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
rem <20><><EFBFBD><EFBFBD>stopͨ<70><CDA8>jps<70><73><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>pid<69><64><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
:stop
|
:stop
|
||||||
for /f "usebackq tokens=1-2" %%a in (`jps -l ^| findstr %AppName%`) do (
|
for /f "usebackq tokens=1-2" %%a in (`jps -l ^| findstr %AppName%`) do (
|
||||||
set pid=%%a
|
set pid=%%a
|
||||||
@@ -48,7 +48,7 @@ rem
|
|||||||
if not defined pid (echo process %AppName% does not exists) else (
|
if not defined pid (echo process %AppName% does not exists) else (
|
||||||
echo prepare to kill %image_name%
|
echo prepare to kill %image_name%
|
||||||
echo start kill %pid% ...
|
echo start kill %pid% ...
|
||||||
rem <20><><EFBFBD>ݽ<EFBFBD><DDBD><EFBFBD>ID<49><44>kill<6C><6C><EFBFBD><EFBFBD>
|
rem <20><><EFBFBD>ݽ<EFBFBD><DDBD><EFBFBD>ID<49><44>kill<6C><6C><EFBFBD><EFBFBD>
|
||||||
taskkill /f /pid %pid%
|
taskkill /f /pid %pid%
|
||||||
)
|
)
|
||||||
goto:eof
|
goto:eof
|
||||||
|
|||||||
2
ry.sh
2
ry.sh
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# ./ry.sh start 启动 stop 停止 restart 重启 status 状态
|
# ./ry.sh start 启动 stop 停止 restart 重启 status 状态
|
||||||
AppName=target/ruoyi.jar
|
AppName=target/worn.jar
|
||||||
|
|
||||||
# JVM参数
|
# JVM参数
|
||||||
JVM_OPTS="-Dname=$AppName -Duser.timezone=Asia/Shanghai -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC"
|
JVM_OPTS="-Dname=$AppName -Duser.timezone=Asia/Shanghai -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC"
|
||||||
|
|||||||
@@ -158,16 +158,16 @@ public class Constants
|
|||||||
/**
|
/**
|
||||||
* 自动识别json对象白名单配置(仅允许解析的包名,范围越小越安全)
|
* 自动识别json对象白名单配置(仅允许解析的包名,范围越小越安全)
|
||||||
*/
|
*/
|
||||||
public static final String[] JSON_WHITELIST_STR = { "com.ruoyi" };
|
public static final String[] JSON_WHITELIST_STR = { "com.shzg" };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加)
|
* 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加)
|
||||||
*/
|
*/
|
||||||
public static final String[] JOB_WHITELIST_STR = { "com.ruoyi.framework.task" };
|
public static final String[] JOB_WHITELIST_STR = { "com.shzg.framework.task" };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 定时任务违规的字符
|
* 定时任务违规的字符
|
||||||
*/
|
*/
|
||||||
public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
|
public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
|
||||||
"org.springframework", "org.apache", "com.ruoyi.common.utils.file", "com.ruoyi.framework.config", "com.ruoyi.project.tool" };
|
"org.springframework", "org.apache", "com.shzg.common.utils.file", "com.shzg.framework.config", "com.shzg.project.tool" };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import com.shzg.common.utils.DateUtils;
|
|||||||
import com.shzg.common.utils.StringUtils;
|
import com.shzg.common.utils.StringUtils;
|
||||||
import com.shzg.common.utils.uuid.IdUtils;
|
import com.shzg.common.utils.uuid.IdUtils;
|
||||||
import com.shzg.common.utils.uuid.Seq;
|
import com.shzg.common.utils.uuid.Seq;
|
||||||
import com.shzg.framework.config.RuoYiConfig;
|
import com.shzg.framework.config.WornConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件上传工具类
|
* 文件上传工具类
|
||||||
@@ -36,7 +36,7 @@ public class FileUploadUtils
|
|||||||
/**
|
/**
|
||||||
* 默认上传的地址
|
* 默认上传的地址
|
||||||
*/
|
*/
|
||||||
private static String defaultBaseDir = RuoYiConfig.getProfile();
|
private static String defaultBaseDir = WornConfig.getProfile();
|
||||||
|
|
||||||
public static void setDefaultBaseDir(String defaultBaseDir)
|
public static void setDefaultBaseDir(String defaultBaseDir)
|
||||||
{
|
{
|
||||||
@@ -170,7 +170,7 @@ public class FileUploadUtils
|
|||||||
|
|
||||||
public static final String getPathFileName(String uploadDir, String fileName) throws IOException
|
public static final String getPathFileName(String uploadDir, String fileName) throws IOException
|
||||||
{
|
{
|
||||||
int dirLastIndex = RuoYiConfig.getProfile().length() + 1;
|
int dirLastIndex = WornConfig.getProfile().length() + 1;
|
||||||
String currentDir = StringUtils.substring(uploadDir, dirLastIndex);
|
String currentDir = StringUtils.substring(uploadDir, dirLastIndex);
|
||||||
return Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName;
|
return Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import com.shzg.common.constant.Constants;
|
|||||||
import com.shzg.common.utils.DateUtils;
|
import com.shzg.common.utils.DateUtils;
|
||||||
import com.shzg.common.utils.StringUtils;
|
import com.shzg.common.utils.StringUtils;
|
||||||
import com.shzg.common.utils.uuid.IdUtils;
|
import com.shzg.common.utils.uuid.IdUtils;
|
||||||
import com.shzg.framework.config.RuoYiConfig;
|
import com.shzg.framework.config.WornConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件处理工具类
|
* 文件处理工具类
|
||||||
@@ -74,7 +74,7 @@ public class FileUtils
|
|||||||
*/
|
*/
|
||||||
public static String writeImportBytes(byte[] data) throws IOException
|
public static String writeImportBytes(byte[] data) throws IOException
|
||||||
{
|
{
|
||||||
return writeBytes(data, RuoYiConfig.getImportPath());
|
return writeBytes(data, WornConfig.getImportPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import com.shzg.common.constant.Constants;
|
import com.shzg.common.constant.Constants;
|
||||||
import com.shzg.common.utils.StringUtils;
|
import com.shzg.common.utils.StringUtils;
|
||||||
import com.shzg.framework.config.RuoYiConfig;
|
import com.shzg.framework.config.WornConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 图片处理工具类
|
* 图片处理工具类
|
||||||
@@ -79,7 +79,7 @@ public class ImageUtils
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// 本机地址
|
// 本机地址
|
||||||
String localPath = RuoYiConfig.getProfile();
|
String localPath = WornConfig.getProfile();
|
||||||
String downloadPath = localPath + StringUtils.substringAfter(url, Constants.RESOURCE_PREFIX);
|
String downloadPath = localPath + StringUtils.substringAfter(url, Constants.RESOURCE_PREFIX);
|
||||||
in = new FileInputStream(downloadPath);
|
in = new FileInputStream(downloadPath);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import com.alibaba.fastjson2.JSONObject;
|
|||||||
import com.shzg.common.constant.Constants;
|
import com.shzg.common.constant.Constants;
|
||||||
import com.shzg.common.utils.StringUtils;
|
import com.shzg.common.utils.StringUtils;
|
||||||
import com.shzg.common.utils.http.HttpUtils;
|
import com.shzg.common.utils.http.HttpUtils;
|
||||||
import com.shzg.framework.config.RuoYiConfig;
|
import com.shzg.framework.config.WornConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取地址类
|
* 获取地址类
|
||||||
@@ -31,7 +31,7 @@ public class AddressUtils
|
|||||||
{
|
{
|
||||||
return "内网IP";
|
return "内网IP";
|
||||||
}
|
}
|
||||||
if (RuoYiConfig.isAddressEnabled())
|
if (WornConfig.isAddressEnabled())
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ import com.shzg.framework.aspectj.lang.annotation.Excel;
|
|||||||
import com.shzg.framework.aspectj.lang.annotation.Excel.ColumnType;
|
import com.shzg.framework.aspectj.lang.annotation.Excel.ColumnType;
|
||||||
import com.shzg.framework.aspectj.lang.annotation.Excel.Type;
|
import com.shzg.framework.aspectj.lang.annotation.Excel.Type;
|
||||||
import com.shzg.framework.aspectj.lang.annotation.Excels;
|
import com.shzg.framework.aspectj.lang.annotation.Excels;
|
||||||
import com.shzg.framework.config.RuoYiConfig;
|
import com.shzg.framework.config.WornConfig;
|
||||||
import com.shzg.framework.web.domain.AjaxResult;
|
import com.shzg.framework.web.domain.AjaxResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1482,7 +1482,7 @@ public class ExcelUtil<T>
|
|||||||
*/
|
*/
|
||||||
public String getAbsoluteFile(String filename)
|
public String getAbsoluteFile(String filename)
|
||||||
{
|
{
|
||||||
String downloadPath = RuoYiConfig.getDownloadPath() + filename;
|
String downloadPath = WornConfig.getDownloadPath() + filename;
|
||||||
File desc = new File(downloadPath);
|
File desc = new File(downloadPath);
|
||||||
if (!desc.getParentFile().exists())
|
if (!desc.getParentFile().exists())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public class CaptchaConfig
|
|||||||
// KAPTCHA_SESSION_KEY
|
// KAPTCHA_SESSION_KEY
|
||||||
properties.setProperty(KAPTCHA_SESSION_CONFIG_KEY, "kaptchaCodeMath");
|
properties.setProperty(KAPTCHA_SESSION_CONFIG_KEY, "kaptchaCodeMath");
|
||||||
// 验证码文本生成器
|
// 验证码文本生成器
|
||||||
properties.setProperty(KAPTCHA_TEXTPRODUCER_IMPL, "com.ruoyi.framework.config.KaptchaTextCreator");
|
properties.setProperty(KAPTCHA_TEXTPRODUCER_IMPL, "com.shzg.framework.config.KaptchaTextCreator");
|
||||||
// 验证码文本字符间距 默认为2
|
// 验证码文本字符间距 默认为2
|
||||||
properties.setProperty(KAPTCHA_TEXTPRODUCER_CHAR_SPACE, "3");
|
properties.setProperty(KAPTCHA_TEXTPRODUCER_CHAR_SPACE, "3");
|
||||||
// 验证码文本字符长度 默认为5
|
// 验证码文本字符长度 默认为5
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class ResourcesConfig implements WebMvcConfigurer
|
|||||||
{
|
{
|
||||||
/** 本地文件上传路径 */
|
/** 本地文件上传路径 */
|
||||||
registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**")
|
registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**")
|
||||||
.addResourceLocations("file:" + RuoYiConfig.getProfile() + "/");
|
.addResourceLocations("file:" + WornConfig.getProfile() + "/");
|
||||||
|
|
||||||
/** swagger配置 */
|
/** swagger配置 */
|
||||||
registry.addResourceHandler("/swagger-ui/**")
|
registry.addResourceHandler("/swagger-ui/**")
|
||||||
|
|||||||
@@ -1,111 +0,0 @@
|
|||||||
package com.shzg.framework.config;
|
|
||||||
|
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 读取项目相关配置
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
@ConfigurationProperties(prefix = "ruoyi")
|
|
||||||
public class RuoYiConfig
|
|
||||||
{
|
|
||||||
/** 项目名称 */
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
/** 版本 */
|
|
||||||
private String version;
|
|
||||||
|
|
||||||
/** 版权年份 */
|
|
||||||
private String copyrightYear;
|
|
||||||
|
|
||||||
/** 上传路径 */
|
|
||||||
private static String profile;
|
|
||||||
|
|
||||||
/** 获取地址开关 */
|
|
||||||
private static boolean addressEnabled;
|
|
||||||
|
|
||||||
public String getName()
|
|
||||||
{
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name)
|
|
||||||
{
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getVersion()
|
|
||||||
{
|
|
||||||
return version;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setVersion(String version)
|
|
||||||
{
|
|
||||||
this.version = version;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCopyrightYear()
|
|
||||||
{
|
|
||||||
return copyrightYear;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCopyrightYear(String copyrightYear)
|
|
||||||
{
|
|
||||||
this.copyrightYear = copyrightYear;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getProfile()
|
|
||||||
{
|
|
||||||
return profile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setProfile(String profile)
|
|
||||||
{
|
|
||||||
RuoYiConfig.profile = profile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isAddressEnabled()
|
|
||||||
{
|
|
||||||
return addressEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAddressEnabled(boolean addressEnabled)
|
|
||||||
{
|
|
||||||
RuoYiConfig.addressEnabled = addressEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取导入上传路径
|
|
||||||
*/
|
|
||||||
public static String getImportPath()
|
|
||||||
{
|
|
||||||
return getProfile() + "/import";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取头像上传路径
|
|
||||||
*/
|
|
||||||
public static String getAvatarPath()
|
|
||||||
{
|
|
||||||
return getProfile() + "/avatar";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取下载路径
|
|
||||||
*/
|
|
||||||
public static String getDownloadPath()
|
|
||||||
{
|
|
||||||
return getProfile() + "/download/";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取上传路径
|
|
||||||
*/
|
|
||||||
public static String getUploadPath()
|
|
||||||
{
|
|
||||||
return getProfile() + "/upload";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -31,7 +31,7 @@ public class SwaggerConfig
|
|||||||
{
|
{
|
||||||
/** 系统基础配置 */
|
/** 系统基础配置 */
|
||||||
@Autowired
|
@Autowired
|
||||||
private RuoYiConfig ruoyiConfig;
|
private WornConfig wornConfig;
|
||||||
|
|
||||||
/** 是否开启swagger */
|
/** 是否开启swagger */
|
||||||
@Value("${swagger.enabled}")
|
@Value("${swagger.enabled}")
|
||||||
@@ -112,13 +112,13 @@ public class SwaggerConfig
|
|||||||
// 用ApiInfoBuilder进行定制
|
// 用ApiInfoBuilder进行定制
|
||||||
return new ApiInfoBuilder()
|
return new ApiInfoBuilder()
|
||||||
// 设置标题
|
// 设置标题
|
||||||
.title("标题:若依管理系统_接口文档")
|
.title("标题:Worn管理系统_接口文档")
|
||||||
// 描述
|
// 描述
|
||||||
.description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
|
.description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
|
||||||
// 作者信息
|
// 作者信息
|
||||||
.contact(new Contact(ruoyiConfig.getName(), null, null))
|
.contact(new Contact(wornConfig.getName(), null, null))
|
||||||
// 版本
|
// 版本
|
||||||
.version("版本号:" + ruoyiConfig.getVersion())
|
.version("版本号:" + wornConfig.getVersion())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||||||
import com.shzg.common.utils.StringUtils;
|
import com.shzg.common.utils.StringUtils;
|
||||||
import com.shzg.common.utils.file.FileUploadUtils;
|
import com.shzg.common.utils.file.FileUploadUtils;
|
||||||
import com.shzg.common.utils.file.FileUtils;
|
import com.shzg.common.utils.file.FileUtils;
|
||||||
import com.shzg.framework.config.RuoYiConfig;
|
import com.shzg.framework.config.WornConfig;
|
||||||
import com.shzg.framework.config.ServerConfig;
|
import com.shzg.framework.config.ServerConfig;
|
||||||
import com.shzg.framework.web.domain.AjaxResult;
|
import com.shzg.framework.web.domain.AjaxResult;
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ public class CommonController
|
|||||||
throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
|
throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
|
||||||
}
|
}
|
||||||
String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
|
String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
|
||||||
String filePath = RuoYiConfig.getDownloadPath() + fileName;
|
String filePath = WornConfig.getDownloadPath() + fileName;
|
||||||
|
|
||||||
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
||||||
FileUtils.setAttachmentResponseHeader(response, realFileName);
|
FileUtils.setAttachmentResponseHeader(response, realFileName);
|
||||||
@@ -77,7 +77,7 @@ public class CommonController
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
// 上传文件路径
|
// 上传文件路径
|
||||||
String filePath = RuoYiConfig.getUploadPath();
|
String filePath = WornConfig.getUploadPath();
|
||||||
// 上传并返回新文件名称
|
// 上传并返回新文件名称
|
||||||
String fileName = FileUploadUtils.upload(filePath, file);
|
String fileName = FileUploadUtils.upload(filePath, file);
|
||||||
String url = serverConfig.getUrl() + fileName;
|
String url = serverConfig.getUrl() + fileName;
|
||||||
@@ -103,7 +103,7 @@ public class CommonController
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
// 上传文件路径
|
// 上传文件路径
|
||||||
String filePath = RuoYiConfig.getUploadPath();
|
String filePath = WornConfig.getUploadPath();
|
||||||
List<String> urls = new ArrayList<String>();
|
List<String> urls = new ArrayList<String>();
|
||||||
List<String> fileNames = new ArrayList<String>();
|
List<String> fileNames = new ArrayList<String>();
|
||||||
List<String> newFileNames = new ArrayList<String>();
|
List<String> newFileNames = new ArrayList<String>();
|
||||||
@@ -145,7 +145,7 @@ public class CommonController
|
|||||||
throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource));
|
throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource));
|
||||||
}
|
}
|
||||||
// 本地资源路径
|
// 本地资源路径
|
||||||
String localPath = RuoYiConfig.getProfile();
|
String localPath = WornConfig.getProfile();
|
||||||
// 数据库资源地址
|
// 数据库资源地址
|
||||||
String downloadPath = localPath + FileUtils.stripPrefix(resource);
|
String downloadPath = localPath + FileUtils.stripPrefix(resource);
|
||||||
// 下载名称
|
// 下载名称
|
||||||
|
|||||||
@@ -4,19 +4,19 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
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;
|
||||||
import com.shzg.common.utils.StringUtils;
|
import com.shzg.common.utils.StringUtils;
|
||||||
import com.shzg.framework.config.RuoYiConfig;
|
import com.shzg.framework.config.WornConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 首页
|
* 首页
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author shzg
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
public class SysIndexController
|
public class SysIndexController
|
||||||
{
|
{
|
||||||
/** 系统基础配置 */
|
/** 系统基础配置 */
|
||||||
@Autowired
|
@Autowired
|
||||||
private RuoYiConfig ruoyiConfig;
|
private WornConfig wornConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 访问首页,提示语
|
* 访问首页,提示语
|
||||||
@@ -24,6 +24,6 @@ public class SysIndexController
|
|||||||
@RequestMapping("/")
|
@RequestMapping("/")
|
||||||
public String index()
|
public String index()
|
||||||
{
|
{
|
||||||
return StringUtils.format("欢迎使用{}后台管理框架,当前版本:v{},请通过前端地址访问。", ruoyiConfig.getName(), ruoyiConfig.getVersion());
|
return StringUtils.format("欢迎使用{}后台管理框架,当前版本:v{},请通过前端地址访问。", wornConfig.getName(), wornConfig.getVersion());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import com.shzg.common.utils.file.FileUtils;
|
|||||||
import com.shzg.common.utils.file.MimeTypeUtils;
|
import com.shzg.common.utils.file.MimeTypeUtils;
|
||||||
import com.shzg.framework.aspectj.lang.annotation.Log;
|
import com.shzg.framework.aspectj.lang.annotation.Log;
|
||||||
import com.shzg.framework.aspectj.lang.enums.BusinessType;
|
import com.shzg.framework.aspectj.lang.enums.BusinessType;
|
||||||
import com.shzg.framework.config.RuoYiConfig;
|
import com.shzg.framework.config.WornConfig;
|
||||||
import com.shzg.framework.security.LoginUser;
|
import com.shzg.framework.security.LoginUser;
|
||||||
import com.shzg.framework.security.service.TokenService;
|
import com.shzg.framework.security.service.TokenService;
|
||||||
import com.shzg.framework.web.controller.BaseController;
|
import com.shzg.framework.web.controller.BaseController;
|
||||||
@@ -128,13 +128,13 @@ public class SysProfileController extends BaseController
|
|||||||
if (!file.isEmpty())
|
if (!file.isEmpty())
|
||||||
{
|
{
|
||||||
LoginUser loginUser = getLoginUser();
|
LoginUser loginUser = getLoginUser();
|
||||||
String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION, true);
|
String avatar = FileUploadUtils.upload(WornConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION, true);
|
||||||
if (userService.updateUserAvatar(loginUser.getUserId(), avatar))
|
if (userService.updateUserAvatar(loginUser.getUserId(), avatar))
|
||||||
{
|
{
|
||||||
String oldAvatar = loginUser.getUser().getAvatar();
|
String oldAvatar = loginUser.getUser().getAvatar();
|
||||||
if (StringUtils.isNotEmpty(oldAvatar))
|
if (StringUtils.isNotEmpty(oldAvatar))
|
||||||
{
|
{
|
||||||
FileUtils.deleteFile(RuoYiConfig.getProfile() + FileUtils.stripPrefix(oldAvatar));
|
FileUtils.deleteFile(WornConfig.getProfile() + FileUtils.stripPrefix(oldAvatar));
|
||||||
}
|
}
|
||||||
AjaxResult ajax = AjaxResult.success();
|
AjaxResult ajax = AjaxResult.success();
|
||||||
ajax.put("imgUrl", avatar);
|
ajax.put("imgUrl", avatar);
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ spring:
|
|||||||
allow:
|
allow:
|
||||||
url-pattern: /druid/*
|
url-pattern: /druid/*
|
||||||
# 控制台管理用户名和密码
|
# 控制台管理用户名和密码
|
||||||
login-username: ruoyi
|
login-username: worn
|
||||||
login-password: 123456
|
login-password: 123456
|
||||||
filter:
|
filter:
|
||||||
stat:
|
stat:
|
||||||
|
|||||||
@@ -139,9 +139,9 @@ xss:
|
|||||||
# 代码生成
|
# 代码生成
|
||||||
gen:
|
gen:
|
||||||
# 作者
|
# 作者
|
||||||
author: ruoyi
|
author: shzg
|
||||||
# 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
|
# 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
|
||||||
packageName: com.ruoyi.project.system
|
packageName: com.shzg.project.system
|
||||||
# 自动去除表前缀,默认是true
|
# 自动去除表前缀,默认是true
|
||||||
autoRemovePre: false
|
autoRemovePre: false
|
||||||
# 表前缀(生成类名不会包含表前缀,多个用逗号分隔)
|
# 表前缀(生成类名不会包含表前缀,多个用逗号分隔)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
Application Version: ${ruoyi.version}
|
Application Version: ${worn.version}
|
||||||
Spring Boot Version: ${spring-boot.version}
|
Spring Boot Version: ${spring-boot.version}
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// _ooOoo_ //
|
// _ooOoo_ //
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<!-- 日志存放路径 -->
|
<!-- 日志存放路径 -->
|
||||||
<property name="log.path" value="/home/ruoyi/logs" />
|
<property name="log.path" value="/home/worn/logs" />
|
||||||
<!-- 日志输出格式 -->
|
<!-- 日志输出格式 -->
|
||||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user