mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-11-26 18:49:23 +08:00
Compare commits
4 Commits
v5.4.1
...
d910c952cc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d910c952cc | ||
|
|
fd5d028e95 | ||
|
|
be32fd8914 | ||
|
|
f67419a253 |
File diff suppressed because it is too large
Load Diff
42
ruoyi-admin/src/test/resources/refactor-config.properties
Normal file
42
ruoyi-admin/src/test/resources/refactor-config.properties
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
# 基于Maven项目结构自动分析和重构
|
||||||
|
|
||||||
|
# 源项目根目录(绝对路径)
|
||||||
|
source.project.root=d:/IDEA/IdeaProjects/RuoYi-Vue-Plus
|
||||||
|
|
||||||
|
# 输出项目目录(重构后的项目将输出到此目录)
|
||||||
|
output.project.root=d:/IDEA/IdeaProjects/RuoYi-Vue-Plus-Refactored
|
||||||
|
|
||||||
|
# 旧的配置
|
||||||
|
old.groupId=org.dromara
|
||||||
|
old.artifactPrefix=ruoyi-
|
||||||
|
old.packagePrefix=org.dromara
|
||||||
|
|
||||||
|
# 新的配置
|
||||||
|
new.groupId=com.example
|
||||||
|
new.artifactPrefix=example-
|
||||||
|
new.packagePrefix=com.example
|
||||||
|
|
||||||
|
# 排除的依赖(用逗号分隔,依赖包名在重构时将保持不变)
|
||||||
|
exclude.packages=org.dromara.warm,org.dromara.sms4j
|
||||||
|
|
||||||
|
# 排除的目录(用逗号分隔)
|
||||||
|
exclude.directories=target,.git,.idea,node_modules,logs,.gitee,.run
|
||||||
|
|
||||||
|
# 排除的文件(用逗号分隔,支持通配符)
|
||||||
|
exclude.files=.flattened-pom.xml,*.log,*.tmp,README.md,LICENSE
|
||||||
|
|
||||||
|
# 清理选项
|
||||||
|
# 是否清理空目录(重构后清理遗留的空目录)
|
||||||
|
cleanup.empty.directories=true
|
||||||
|
# 清理空目录的最大深度(防止误删重要目录)
|
||||||
|
cleanup.max.depth=10
|
||||||
|
# 需要保护的目录(即使为空也不删除,用逗号分隔)
|
||||||
|
protected.directories=src,main,test,java,resources,webapp,META-INF,WEB-INF
|
||||||
|
|
||||||
|
# 跨平台配置
|
||||||
|
# 路径分隔符处理策略(auto=自动检测,unix=/,windows=\)
|
||||||
|
path.separator.strategy=auto
|
||||||
|
# 文件编码(默认UTF-8,确保跨平台兼容)
|
||||||
|
file.encoding=UTF-8
|
||||||
|
# 换行符处理策略(auto=自动检测,unix=LF,windows=CRLF)
|
||||||
|
line.separator.strategy=auto
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
package org.dromara.demo.controller;
|
package org.dromara.demo.controller;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaIgnore;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.mail.utils.MailUtils;
|
import org.dromara.common.mail.utils.MailUtils;
|
||||||
@@ -18,7 +17,6 @@ import java.util.Arrays;
|
|||||||
*
|
*
|
||||||
* @author Michelle.Chung
|
* @author Michelle.Chung
|
||||||
*/
|
*/
|
||||||
@SaIgnore
|
|
||||||
@Validated
|
@Validated
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@RestController
|
@RestController
|
||||||
@@ -44,11 +42,11 @@ public class MailController {
|
|||||||
* @param to 接收人
|
* @param to 接收人
|
||||||
* @param subject 标题
|
* @param subject 标题
|
||||||
* @param text 内容
|
* @param text 内容
|
||||||
* @param filePath 附件路径
|
|
||||||
*/
|
*/
|
||||||
@GetMapping("/sendMessageWithAttachment")
|
@GetMapping("/sendMessageWithAttachment")
|
||||||
public R<Void> sendMessageWithAttachment(String to, String subject, String text, String filePath) {
|
public R<Void> sendMessageWithAttachment(String to, String subject, String text) {
|
||||||
MailUtils.sendText(to, subject, text, new File(filePath));
|
// 附件路径 禁止前端传递 有任意读取系统文件风险
|
||||||
|
MailUtils.sendText(to, subject, text, new File("/xxx/xxx"));
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,10 +56,11 @@ public class MailController {
|
|||||||
* @param to 接收人
|
* @param to 接收人
|
||||||
* @param subject 标题
|
* @param subject 标题
|
||||||
* @param text 内容
|
* @param text 内容
|
||||||
* @param paths 附件路径
|
|
||||||
*/
|
*/
|
||||||
@GetMapping("/sendMessageWithAttachments")
|
@GetMapping("/sendMessageWithAttachments")
|
||||||
public R<Void> sendMessageWithAttachments(String to, String subject, String text, String[] paths) {
|
public R<Void> sendMessageWithAttachments(String to, String subject, String text) {
|
||||||
|
// 附件路径 禁止前端传递 有任意读取系统文件风险
|
||||||
|
String[] paths = new String[]{"/xxx/xxx", "/xxx/xxx"};
|
||||||
File[] array = Arrays.stream(paths).map(File::new).toArray(File[]::new);
|
File[] array = Arrays.stream(paths).map(File::new).toArray(File[]::new);
|
||||||
MailUtils.sendText(to, subject, text, array);
|
MailUtils.sendText(to, subject, text, array);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
|
|||||||
Reference in New Issue
Block a user