Commit ea03f072 authored by rocosen's avatar rocosen

Update util.ts

parent 01e5773b
......@@ -7,17 +7,14 @@ export function resolveHtmlPath(htmlFileName: string) {
if (process.env.NODE_ENV === 'development') {
const port = process.env.PORT || 1212;
const url = new URL(`http://localhost:${port}`);
url.pathname = htmlFileName;1234
url.pathname = htmlFileName
let goPath = url.href.replace('%23', '#')
return goPath;
}else{
let opts = require('url').format({
protocol: 'file:',
slashes: true,
pathname: resolve(__dirname, '../renderer/'),
hash:htmlFileName
})
// return `file://${path.resolve(__dirname, '../renderer/', htmlFileName)}`;
return opts
let dd = `file://${path.resolve(__dirname, '../renderer/', htmlFileName)}`
let ff = dd.replace(/\\/g,'/')
return ff;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment