mirror of
https://github.com/fanchenio/DawnLauncher.git
synced 2025-07-14 05:12:11 +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);
|
let $ = cheerio.load(data);
|
||||||
// 获取标题
|
// 获取标题
|
||||||
result.name = $("head").find("title").text();
|
result.name = $("head").find("title").text();
|
||||||
|
if (!result.name || result.name.trim() === "") {
|
||||||
|
result.name = $("title").text();
|
||||||
|
}
|
||||||
// 获取图标URL
|
// 获取图标URL
|
||||||
let iconURL: string | null = null;
|
let iconURL: string | null = null;
|
||||||
let icon = $("link[rel='icon']");
|
let icon = $("link[rel='icon']");
|
||||||
@ -272,6 +275,9 @@ function analysisHTML(windowName: string, url: string, data: string) {
|
|||||||
result.status = true;
|
result.status = true;
|
||||||
sendUrlInfo(windowName, result);
|
sendUrlInfo(windowName, result);
|
||||||
} else {
|
} else {
|
||||||
|
if (result.name && result.name.trim() !== "") {
|
||||||
|
result.status = true;
|
||||||
|
}
|
||||||
sendUrlInfo(windowName, result);
|
sendUrlInfo(windowName, result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -833,8 +833,10 @@ onMounted(() => {
|
|||||||
getURLInfoLoading.value = false;
|
getURLInfoLoading.value = false;
|
||||||
let res: Result = data;
|
let res: Result = data;
|
||||||
if (res.status) {
|
if (res.status) {
|
||||||
|
if (res.icon && res.icon.trim() !== "") {
|
||||||
form.data.icon = res.icon;
|
form.data.icon = res.icon;
|
||||||
form.data.htmlIcon = null;
|
form.data.htmlIcon = null;
|
||||||
|
}
|
||||||
form.name = res.name ?? "";
|
form.name = res.name ?? "";
|
||||||
} else {
|
} else {
|
||||||
window.api.showErrorMessageBox(
|
window.api.showErrorMessageBox(
|
||||||
|
Loading…
Reference in New Issue
Block a user