diff --git a/app/electron/boot.html b/app/electron/boot.html index a22bb1c8c..9857f0482 100644 --- a/app/electron/boot.html +++ b/app/electron/boot.html @@ -33,6 +33,23 @@ const sleep = (ms) => { return new Promise(resolve => setTimeout(resolve, ms)) } + + const getSearch = (key) => { + if (window.location.search.indexOf('?') === -1) { + return '' + } + let value = '' + const data = window.location.search.split('?')[1].split('&') + data.find(item => { + const keyValue = item.split('=') + if (keyValue[0] === key) { + value = keyValue[1] + return true + } + }) + return value + } + const redirect = () => { const uri = 'http://127.0.0.1:' + location.port if (navigator.userAgent.match(/Android/i)) @@ -41,7 +58,8 @@ window.location.replace(uri) } (async () => { - document.getElementById('details').textContent = 'Booting kernel...' + const v = getSearch('v') + document.getElementById('details').textContent = "v" + v + ' Booting kernel...' let progressing = false while (!progressing) { try { diff --git a/app/electron/main.js b/app/electron/main.js index 5e46143a4..5a61ece4b 100644 --- a/app/electron/main.js +++ b/app/electron/main.js @@ -402,7 +402,7 @@ const initKernel = (workspace, port, lang) => { if (isDevEnv) { bootIndex = path.join(appDir, "electron", "boot.html"); } - bootWindow.loadFile(bootIndex); + bootWindow.loadFile(bootIndex, {query: {v: appVer}}); bootWindow.show(); const kernelName = "win32" === process.platform ? "SiYuan-Kernel.exe" : "SiYuan-Kernel";