Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
netdisc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rocosen
netdisc
Commits
a4de65ea
Commit
a4de65ea
authored
Nov 24, 2022
by
rocosen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
1
parent
412ea67c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
main.ts
src/main/main.ts
+4
-4
util.ts
src/main/util.ts
+2
-1
No files found.
src/main/main.ts
View file @
a4de65ea
...
...
@@ -73,10 +73,10 @@ ipcMain.on('createNewWindow', () => {
});
// win.loadURL(path.join('file:', __dirname, 'new.html')); //new.html是新开窗口的渲染进程
// win.loadURL(winURL);
// win.loadURL(resolveHtmlPath('index.html/#/site'
));
win
.
loadFile
(
resolveHtmlPath
(
'/index.html'
),
{
hash
:
'site'
,
});
win
.
loadURL
(
resolveHtmlPath
(
`index.html#/site`
));
//
win.loadFile(resolveHtmlPath('/index.html'), {
//
hash: 'site',
//
});
// win.loadURL(process.resourcesPath)
// win.webContents.openDevTools()
...
...
src/main/util.ts
View file @
a4de65ea
...
...
@@ -7,7 +7,8 @@ export function resolveHtmlPath(htmlFileName: string) {
const
port
=
process
.
env
.
PORT
||
1212
;
const
url
=
new
URL
(
`http://localhost:
${
port
}
`
);
url
.
pathname
=
htmlFileName
;
return
url
.
href
;
let
goPath
=
url
.
href
.
replace
(
'%23'
,
'#'
)
return
goPath
;
}
return
`file://
${
path
.
resolve
(
__dirname
,
'../renderer/'
,
htmlFileName
)}
`
;
}
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