Commit bc67149b by 田超

Merge branch 'feature/1006021' into 'master'

feat:[1006021]域名合并

See merge request rays/pcloud-common-parent!238
parents f5df57ad 2f25fafc
...@@ -227,20 +227,47 @@ public class ServeLinkUtils { ...@@ -227,20 +227,47 @@ public class ServeLinkUtils {
protocol = "http://"; protocol = "http://";
} }
String resultUrl = ""; String resultUrl = "";
if (StringUtil.isEmpty(random)) {
random = officialAccountsId;
}
if (!StringUtil.isEmpty(serveLink)) { if (!StringUtil.isEmpty(serveLink)) {
if (serveLink.startsWith("http")) {
return serveLink;
}
if (serveLink.startsWith("*")) { if (serveLink.startsWith("*")) {
String endUrl = serveLink.substring(serveLink.indexOf("/"), serveLink.length()); String endUrl = serveLink.substring(serveLink.indexOf("/"));
if (random == null) { resultUrl = protocol + "weixin" + random + "." + firstDomain + "/" + serveLink.substring(1, serveLink.indexOf("/")) + "/W"
resultUrl = protocol + "app." + firstDomain + "/" + serveLink.substring(1, serveLink.indexOf("/")) + "/W"
+ officialAccountsId + endUrl; + officialAccountsId + endUrl;
} else {
resultUrl = protocol + "app" + random + "." + firstDomain + "/" + serveLink.substring(1, serveLink.indexOf("/")) + "/W"
+ officialAccountsId + endUrl;
}
} else { } else {
resultUrl = protocol + domain + "/W" + officialAccountsId + serveLink; resultUrl = protocol + domain + "/W" + officialAccountsId + serveLink;
} }
} }
return resultUrl; return resultUrl;
} }
/**
* 获取作品/应用跳转链接(包含域名)
*/
public static String splitUrl(String url, Long officialAccountsId, String protocol, String domain, String firstDomain, Long random) {
if (StringUtil.isEmpty(url) || null == officialAccountsId) {
return url;
}
if (null == random) {
random = officialAccountsId;
}
return getCompleteLink(url, officialAccountsId.toString(), protocol, domain, firstDomain, random.toString());
}
/**
* 获取作品/应用跳转链接的域名
*/
public static String getAppDomain(Long officialAccountsId, Long random, String firstDomain) {
if (null == officialAccountsId || StringUtil.isEmpty(firstDomain)){
return null;
}
if (null == random) {
random = officialAccountsId;
}
return "weixin" + random + "." + firstDomain;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment