Skip to content

Commit

Permalink
1.1.156
Browse files Browse the repository at this point in the history
  • Loading branch information
wushuo894 committed Oct 25, 2024
1 parent ea2f53c commit 9a9d3c4
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 12 deletions.
4 changes: 2 additions & 2 deletions UPDATE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
优化通知测试
修复了server酱3的问题 @Jisxu

通知webhook支持更多参数
邮箱通知也支持发送图片了
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>ani.rss</groupId>
<artifactId>ani-rss</artifactId>
<version>1.1.155</version>
<version>1.1.156</version>

<properties>
<maven.compiler.source>11</maven.compiler.source>
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/ani/rss/entity/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ public class Config implements Serializable {
*/
private String mailAddressee;

/**
* mail 发送图片
*/
private Boolean mailImage;

/**
* 登录信息
*/
Expand Down
13 changes: 8 additions & 5 deletions src/main/java/ani/rss/msg/Mail.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,16 @@ public Boolean send(Config config, Ani ani, String text, MessageEnum messageEnum

messageBody = messageBody.replace("\n", "<br/>");

String image = "https://docs.wushuo.top/image/null.png";
Boolean mailImage = config.getMailImage();
if (mailImage) {
String image = "https://docs.wushuo.top/image/null.png";

if (Objects.nonNull(ani)) {
image = ani.getImage();
}
if (Objects.nonNull(ani)) {
image = ani.getImage();
}

messageBody += StrFormatter.format("<br/><img src=\"{}\"/>", image);
messageBody += StrFormatter.format("<br/><img src=\"{}\"/>", image);
}

try {
MailUtil.send(mailAccount, List.of(mailAddressee), text, messageBody, true);
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/ani/rss/util/ConfigUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import ani.rss.entity.Login;
import ani.rss.entity.MyMailAccount;
import ani.rss.enums.MessageEnum;
import ani.rss.enums.ServerChanTypeEnum;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.io.FileUtil;
Expand Down Expand Up @@ -65,6 +66,7 @@ public class ConfigUtil {
.setDownloadCount(0)
.setMail(false)
.setMailAddressee("")
.setMailImage(true)
.setMailAccount(
new MyMailAccount()
.setHost("")
Expand Down Expand Up @@ -113,7 +115,7 @@ public class ConfigUtil {
))
.setVerifyLoginIp(true)
.setServerChan(false)
.setServerChanType("")
.setServerChanType(ServerChanTypeEnum.SERVER_CHAN.getType())
.setServerChanSendKey("")
.setServerChan3ApiUrl("")
.setSystemMsg(false)
Expand Down
8 changes: 5 additions & 3 deletions ui/src/config/Message.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@
<el-input v-model:model-value="props.config.mailAddressee" :disabled="!config.mail"
placeholder="[email protected]"></el-input>
</el-form-item>
<el-form-item label="图片">
<el-switch v-model:model-value="props.config.mailImage" :disabled="!config.mail"/>
</el-form-item>
<el-form-item label="开关">
<div style="width: 100%;display: flex;justify-content: space-between;">
<el-switch v-model:model-value="props.config.mail"></el-switch>
Expand All @@ -127,11 +130,10 @@
</el-select>
</el-form-item>
<el-form-item label="sendKey" v-if="props.config.serverChanType === 'serverChan'">
<el-input v-model="props.config.serverChanSendKey"></el-input>
<el-input v-model="props.config.serverChanSendKey" placeholder="1234567890"></el-input>
</el-form-item>

<el-form-item label="apiUrl" v-else-if="props.config.serverChanType === 'serverChan3'">
<el-input v-model="props.config.serverChan3ApiUrl"></el-input>
<el-input v-model="props.config.serverChan3ApiUrl" placeholder="https://<uid>.push.ft07.com/send/<sendKey>.send"></el-input>
</el-form-item>
<el-form-item label="开关">
<div style="display: flex;width: 100%;justify-content: space-between;">
Expand Down
1 change: 1 addition & 0 deletions ui/src/home/Config.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ const config = ref({
'pass': '',
'sslEnable': false
},
'mailImage': true,
'login': {
'username': '',
'password': ''
Expand Down

0 comments on commit 9a9d3c4

Please sign in to comment.