From 89a0900ec7b4040a13f49376ede6388ab3cb5640 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=AD=E8=8D=A3=E4=BC=8A?= <243653385@qq.com> Date: Fri, 13 Dec 2019 10:00:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=92=89=E9=92=89=E6=B6=88?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/org/yzr/utils/webhook/DingDingWebHook.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/yzr/utils/webhook/DingDingWebHook.java b/src/main/java/org/yzr/utils/webhook/DingDingWebHook.java index 3c17c0f..53a4f2f 100644 --- a/src/main/java/org/yzr/utils/webhook/DingDingWebHook.java +++ b/src/main/java/org/yzr/utils/webhook/DingDingWebHook.java @@ -51,13 +51,14 @@ public class DingDingWebHook implements IWebHook { } Map markdown = new HashMap<>(); markdown.put("title", app.getName()); - String url = pathManager.getBaseURL(false) + "s/" + app.getShortCode() + "?id=" + app.getCurrentPackage().getId(); + String currentPackageURL = pathManager.getBaseURL(false) + "s/" + app.getShortCode() + "?id=" + app.getCurrentPackage().getId(); + String appURL = pathManager.getBaseURL(false) + "apps/" + app.getId(); String platform = "iOS"; if (app.getPlatform().equalsIgnoreCase("android")) { platform = "Android"; } - String appInfo = String.format("[%s(%s)更新](%s)", app.getName(), platform, url); + String appInfo = String.format("[%s(%s)更新](%s)", app.getName(), platform, appURL); String iconPath = PathManager.getFullPath(app.getCurrentPackage()) + "icon.png"; // 将图片转为 base64, 内网 ip 钉钉无法访问,直接给图片数据 @@ -65,11 +66,11 @@ public class DingDingWebHook implements IWebHook { File codeFile = new File(codePath); // 图片不存在,生成图片 if (!codeFile.exists()) { - QRCodeUtil.encode(url).withSize(150, 150).withIcon(new File(iconPath)).writeTo(new File(codePath)); + QRCodeUtil.encode(currentPackageURL).withSize(150, 150).withIcon(new File(iconPath)).writeTo(new File(codePath)); } String icon = "data:image/jpg;base64," + ImageUtils.convertImageToBase64(codePath); String pathInfo = String.format("![%s](%s)", app.getName(), icon); - String otherInfo = String.format("链接:[%s](%s) \n\n 版本:%s (Build: %s)", url, url, app.getCurrentPackage().getVersion(), app.getCurrentPackage().getBuildVersion()); + String otherInfo = String.format("链接:[前往下载🛫](%s) \n\n 版本:%s (Build: %s)", currentPackageURL, app.getCurrentPackage().getVersion(), app.getCurrentPackage().getBuildVersion()); String message = this.getPackageMessage(app.getCurrentPackage()); String text = appInfo + " \n\n " + pathInfo + " \n\n " + otherInfo; if (message.length() > 0) {