🦄 refactor(msgManager): 删除不需要的函数
This commit is contained in:
parent
bac31139af
commit
1c33eed181
|
|
@ -162,40 +162,6 @@ class MessageQueue extends EventEmitter {
|
|||
sign = sign.toUpperCase();
|
||||
return sign;
|
||||
}
|
||||
|
||||
formatUrls(urls) {
|
||||
if (!urls) {
|
||||
return '<span style="color: #6c757d;">无链接</span>';
|
||||
}
|
||||
|
||||
// 处理数组形式的URLs
|
||||
if (Array.isArray(urls)) {
|
||||
if (urls.length === 0) {
|
||||
return '<span style="color: #6c757d;">无链接</span>';
|
||||
}
|
||||
|
||||
if (urls.length === 1) {
|
||||
return `<a href="${urls[0]}" target="_blank" style="color: #007bff; text-decoration: none; padding: 6px 12px; background-color: #e3f2fd; border-radius: 4px; font-size: 12px; border: 1px solid #90caf9; display: inline-block;">📄 查看</a>`;
|
||||
}
|
||||
|
||||
// 多个链接的情况
|
||||
let linksHtml = '<div style="line-height: 1.6;">';
|
||||
urls.forEach((url, index) => {
|
||||
linksHtml += `<a href="${url}" target="_blank" style="color: #007bff; text-decoration: none; padding: 4px 8px; background-color: #e3f2fd; border-radius: 3px; font-size: 11px; margin: 2px; display: inline-block; border: 1px solid #90caf9;">📄 链接${
|
||||
index + 1
|
||||
}</a>`;
|
||||
});
|
||||
linksHtml += "</div>";
|
||||
return linksHtml;
|
||||
}
|
||||
|
||||
// 处理字符串形式的URL
|
||||
if (typeof urls === "string") {
|
||||
return `<a href="${urls}" target="_blank" style="color: #007bff; text-decoration: none; padding: 6px 12px; background-color: #e3f2fd; border-radius: 4px; font-size: 12px; border: 1px solid #90caf9; display: inline-block;">📄 查看</a>`;
|
||||
}
|
||||
|
||||
return '<span style="color: #6c757d;">链接格式错误</span>';
|
||||
}
|
||||
}
|
||||
|
||||
const messageQueue = new MessageQueue();
|
||||
|
|
|
|||
Loading…
Reference in New Issue