优化bug

This commit is contained in:
24kycj
2025-03-30 21:50:55 +08:00
parent 6f90c7dc69
commit 1e4407871e
4 changed files with 25 additions and 5 deletions
+6 -4
View File
@@ -215,7 +215,8 @@
fsData = fs.readFileSync(fullPath);
let soonData = fs.readFileSync($(this).attr("data"))
let j = JSON.parse(soonData.toString());
ipcRenderer.send('open-design-page', $(this).attr("data"), j.soonType);
let type = j.soonType ? j.soonType : j.backBlackPic ? 2 : 1;
ipcRenderer.send('open-design-page', $(this).attr("data"), type);
} catch (e) {
layer.msg(language_str("noFile"));//当前文件不存在
let j = JSON.parse(fsData.toString());
@@ -261,10 +262,11 @@
}).then(result => {
console.log(result.canceled)
console.log(result.filePaths)
if (result.canceled) return;
let soonData = fs.readFileSync(result.filePaths)
if (result.canceled || !result.filePaths[0]) return;
let soonData = fs.readFileSync(result.filePaths[0])
let j = JSON.parse(soonData.toString());
ipcRenderer.send('open-design-page', result.filePaths, j.soonType);
let type = j.soonType ? j.soonType : j.backBlackPic ? 2 : 1;
ipcRenderer.send('open-design-page', result.filePaths[0], type);
//console.log(result.filePaths)
}).catch(err => {
console.log(err)