Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
electron-printer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhuzhequan
electron-printer
Commits
530e2bc6
Commit
530e2bc6
authored
Jul 13, 2026
by
linjinhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:添加默认路径为桌面JomallProductionAssistant-DTF
parent
0bc94680
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
15 deletions
+8
-15
src/background.js
+7
-12
src/views/dtf-list/index.vue
+1
-3
No files found.
src/background.js
View file @
530e2bc6
...
@@ -494,23 +494,18 @@ async function createWindow() {
...
@@ -494,23 +494,18 @@ async function createWindow() {
});
});
ipcMain
.
on
(
"get-install-path"
,
event
=>
{
ipcMain
.
on
(
"get-install-path"
,
event
=>
{
let
psScriptPath
;
// 固定桌面路径,不再区分开发环境
if
(
process
.
env
.
NODE_ENV
===
"development"
)
{
const
desktopPath
=
app
.
getPath
(
"desktop"
);
psScriptPath
=
__dirname
;
const
dtfDir
=
path
.
join
(
desktopPath
,
"JomallProductionAssistant-DTF"
);
}
else
{
psScriptPath
=
path
.
dirname
(
app
.
getPath
(
"exe"
));
}
const
dtfDir
=
path
.
join
(
psScriptPath
,
"DTF"
);
try
{
try
{
//
2. 确保目录存在:不存在则递归创建,已存在则直接跳过,不会
报错
//
递归创建文件夹,不存在自动生成,存在不
报错
fs
.
mkdirSync
(
dtfDir
,
{
recursive
:
true
});
fs
.
mkdirSync
(
dtfDir
,
{
recursive
:
true
});
// 3. 返回 DTF 目录路径
event
.
returnValue
=
dtfDir
;
event
.
returnValue
=
dtfDir
;
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
error
(
"创建 DTF 文件夹失败:"
,
err
);
console
.
error
(
"创建 DTF
桌面
文件夹失败:"
,
err
);
//
创建失败时兜底返回安装根目录,避免渲染进程拿不到值报错
//
兜底返回桌面,防止空值
event
.
returnValue
=
psScript
Path
;
event
.
returnValue
=
desktop
Path
;
}
}
});
});
...
...
src/views/dtf-list/index.vue
View file @
530e2bc6
...
@@ -141,12 +141,10 @@ export default {
...
@@ -141,12 +141,10 @@ export default {
methods
:
{
methods
:
{
async
loadLocalConfig
()
{
async
loadLocalConfig
()
{
console
.
log
(
getDTFSetting
());
console
.
log
(
getDTFSetting
());
setDTFSetting
({
downloadDir
:
""
});
try
{
try
{
if
(
!
getDTFSetting
().
downloadDir
)
{
if
(
!
getDTFSetting
().
downloadDir
)
{
const
path
=
ipcRenderer
.
sendSync
(
"get-install-path"
);
const
path
=
ipcRenderer
.
sendSync
(
"get-install-path"
);
console
.
log
(
111111
);
setDTFSetting
({
downloadDir
:
path
});
setDTFSetting
({
downloadDir
:
path
});
}
}
}
catch
(
error
)
{
}
catch
(
error
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment