fix(core): 修复nwjs下server端文件下载异常

This commit is contained in:
王立帮
2025-09-30 08:39:23 +08:00
parent f9d9c4c7ae
commit 5651def093
2 changed files with 71 additions and 32 deletions

View File

@@ -254,6 +254,9 @@ Setting.configMenuGetValue = (obj) => {
Setting.refreshUpdateMenuStatus = (localVersion, cloudVersion, needsUpdate, url) => {
const $serverDiv = $('#setting-menu-update-server');
const $btnDiv = $('#setting-menu-update > div:nth-child(2)');
const $button = $btnDiv.children('button');
$button.removeClass('layui-btn-disabled');
$button.addClass('self-adaption-btn');
const $mixlyProgress = $serverDiv.find('.mixly-progress');
$serverDiv.find('span').css('display', 'none');
$mixlyProgress.hide();
@@ -269,7 +272,9 @@ Setting.refreshUpdateMenuStatus = (localVersion, cloudVersion, needsUpdate, url)
}
if (needsUpdate) {
$btnDiv.css('display', 'flex');
$btnDiv.children('button').off().one('click', (event) => {
$button.off().one('click', (event) => {
$button.addClass('layui-btn-disabled');
$button.removeClass('self-adaption-btn');
const eventSource = new EventSource(`/api/download?url=${encodeURIComponent(url)}&cloudVersion=${cloudVersion}`);
$mixlyProgress.show();
eventSource.onmessage = function(event) {