feat: electron app (#1586)

This commit is contained in:
Peng Xiao
2023-03-16 22:58:21 +08:00
committed by GitHub
parent 6ae06d5609
commit 88f662e6f6
42 changed files with 6597 additions and 284 deletions
+16
View File
@@ -0,0 +1,16 @@
import { protocol } from 'electron';
import { join } from 'path';
export function registerProtocol() {
protocol.interceptFileProtocol('file', (request, callback) => {
const url = request.url.replace(/^file:\/\//, '');
if (url.startsWith('./')) {
const realpath = join(
__dirname,
'../../../resources/web-static',
decodeURIComponent(url)
);
callback(realpath);
}
});
}