mirror of
https://github.com/fanchenio/DawnLauncher.git
synced 2025-07-13 12:52:10 +08:00
优化部分网址获取信息失败的问题。
This commit is contained in:
parent
0ad813a315
commit
0327dfc0cc
@ -209,6 +209,9 @@ function analysisHTML(windowName: string, url: string, data: string) {
|
||||
let $ = cheerio.load(data);
|
||||
// 获取标题
|
||||
result.name = $("head").find("title").text();
|
||||
if (!result.name || result.name.trim() === "") {
|
||||
result.name = $("title").text();
|
||||
}
|
||||
// 获取图标URL
|
||||
let iconURL: string | null = null;
|
||||
let icon = $("link[rel='icon']");
|
||||
@ -272,6 +275,9 @@ function analysisHTML(windowName: string, url: string, data: string) {
|
||||
result.status = true;
|
||||
sendUrlInfo(windowName, result);
|
||||
} else {
|
||||
if (result.name && result.name.trim() !== "") {
|
||||
result.status = true;
|
||||
}
|
||||
sendUrlInfo(windowName, result);
|
||||
}
|
||||
}
|
||||
|
@ -833,8 +833,10 @@ onMounted(() => {
|
||||
getURLInfoLoading.value = false;
|
||||
let res: Result = data;
|
||||
if (res.status) {
|
||||
form.data.icon = res.icon;
|
||||
form.data.htmlIcon = null;
|
||||
if (res.icon && res.icon.trim() !== "") {
|
||||
form.data.icon = res.icon;
|
||||
form.data.htmlIcon = null;
|
||||
}
|
||||
form.name = res.name ?? "";
|
||||
} else {
|
||||
window.api.showErrorMessageBox(
|
||||
|
Loading…
Reference in New Issue
Block a user