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) {