From 534e70e8ad44be42b312d3dd110a38d94c671ec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=AB=8B=E5=B8=AE?= <3294713004@qq.com> Date: Thu, 6 Mar 2025 22:00:50 +0800 Subject: [PATCH] =?UTF-8?q?Fix:=20=E4=BF=AE=E5=A4=8D=E5=B9=B3=E6=9D=BF?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E4=B8=8B=E6=89=93=E5=BC=80=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=97=B6=E6=97=A0=E6=B3=95=E9=80=89=E6=8B=A9=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/modules/mixly-modules/web/file.js | 47 ++++-------------------- 1 file changed, 7 insertions(+), 40 deletions(-) diff --git a/common/modules/mixly-modules/web/file.js b/common/modules/mixly-modules/web/file.js index ddb297e1..88ce84ad 100644 --- a/common/modules/mixly-modules/web/file.js +++ b/common/modules/mixly-modules/web/file.js @@ -25,46 +25,13 @@ const { File } = Web; File.obj = null; File.open = async () => { - if (window.location.protocol === 'https:') { - let filters = []; - MFile.openFilters.map((data) => { - filters.push('.' + data); - }); - const fileConfig = { - multiple: false, - types: [{ - description: 'Mixly File', - accept: { - 'application/xml': filters - } - }], - suggestedStartLocation: 'pictures-library' - }; - try { - const [ obj ] = await window.showOpenFilePicker(fileConfig); - if (!obj) { - return; - } - File.obj = obj; - const extname = path.extname(obj.name); - const fileInfo = await File.obj.getFile(); - if (!fileInfo) { - return; - } - File.parseData(extname, await fileInfo.text()); - Title.updateTitle(obj.name + ' - ' + Title.title); - } catch (error) { - console.log(error); - } - } else { - const filters = '.' + MFile.openFilters.join(',.'); - MFile.openFile(filters, 'text', (fileObj) => { - let { data, filename } = fileObj; - const extname = path.extname(filename); - File.parseData(extname, data); - Title.updateTitle(filename + ' - ' + Title.title); - }); - } + const filters = '.' + MFile.openFilters.join(',.'); + MFile.openFile(filters, 'text', (fileObj) => { + let { data, filename } = fileObj; + const extname = path.extname(filename); + File.parseData(extname, data); + Title.updateTitle(filename + ' - ' + Title.title); + }); } File.parseData = (extname, text) => {