fix: 客户端偶尔出现无法打开文件的情况

This commit is contained in:
kuaifan
2022-02-09 21:04:03 +08:00
parent b28be29dc8
commit e89ff02b59
5 changed files with 34 additions and 12 deletions

2
electron/build.js vendored
View File

@@ -33,7 +33,7 @@ function startBuild(data, publish) {
// index.html
let indexFile = path.resolve(electronDir, "index.html");
let indexString = fs.readFileSync(indexFile, 'utf8');
indexString = indexString.replace(`<title></title>`, `<title>${data.name}</title>`);
indexString = indexString.replace(/<title>(.*?)<\/title>/g, `<title>${data.name}</title>`);
fs.writeFileSync(indexFile, indexString, 'utf8');
// package.json Backup
fse.copySync(packageFile, packageBakFile)