mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-13 20:12:48 +00:00
perf: 优化客户端
This commit is contained in:
parent
f9540b08cd
commit
a99c2f6944
1
electron/build.js
vendored
1
electron/build.js
vendored
@ -512,6 +512,7 @@ async function startBuild(data) {
|
||||
fse.copySync(path.resolve(__dirname, "../public/language"), path.resolve(electronDir, "language"))
|
||||
// config.js
|
||||
fs.writeFileSync(electronDir + "/config.js", "window.systemInfo = " + JSON.stringify(systemInfo), 'utf8');
|
||||
fs.writeFileSync(electronDir + "/dark", '', 'utf8');
|
||||
fs.writeFileSync(nativeCachePath, utils.formatUrl(data.url));
|
||||
fs.writeFileSync(devloadCachePath, "", 'utf8');
|
||||
// index.html
|
||||
|
||||
4
resources/assets/js/app.js
vendored
4
resources/assets/js/app.js
vendored
@ -1,4 +1,4 @@
|
||||
const isElectron = !!(window && window.process && window.process.type);
|
||||
const isElectron = !!(window && window.process && window.process.type && window.electron);
|
||||
const isEEUiApp = window && window.navigator && /eeui/i.test(window.navigator.userAgent);
|
||||
const isSoftware = isElectron || isEEUiApp;
|
||||
|
||||
@ -192,7 +192,7 @@ $A.isElectron = isElectron;
|
||||
$A.isSoftware = isSoftware;
|
||||
$A.openLog = false;
|
||||
if (isElectron) {
|
||||
$A.Electron = electron;
|
||||
$A.Electron = window.electron;
|
||||
$A.Platform = /macintosh|mac os x/i.test(navigator.userAgent) ? "mac" : "win";
|
||||
$A.isMainElectron = /\s+MainTaskWindow\//.test(window.navigator.userAgent);
|
||||
$A.isSubElectron = /\s+SubTaskWindow\//.test(window.navigator.userAgent);
|
||||
|
||||
18
resources/assets/js/store/actions.js
vendored
18
resources/assets/js/store/actions.js
vendored
@ -1106,10 +1106,9 @@ export default {
|
||||
* @param dispatch
|
||||
* @param params
|
||||
*/
|
||||
openChildWindow({dispatch}, params) {
|
||||
dispatch("userUrl", params.path).then(path => {
|
||||
$A.Electron.sendMessage('openChildWindow', Object.assign(params, {path}))
|
||||
})
|
||||
async openChildWindow({dispatch}, params) {
|
||||
const path = await dispatch("userUrl", params.path)
|
||||
$A.Electron.sendMessage('openChildWindow', Object.assign(params, {path}))
|
||||
},
|
||||
|
||||
/**
|
||||
@ -1117,14 +1116,11 @@ export default {
|
||||
* @param dispatch
|
||||
* @param url
|
||||
*/
|
||||
openWebTabWindow({dispatch}, url) {
|
||||
if ($A.getDomain(url) != $A.getDomain($A.mainUrl())) {
|
||||
$A.Electron.sendMessage('openWebTabWindow', {url})
|
||||
return
|
||||
async openWebTabWindow({dispatch}, url) {
|
||||
if ($A.getDomain(url) == $A.getDomain($A.mainUrl())) {
|
||||
url = await dispatch("userUrl", url)
|
||||
}
|
||||
dispatch("userUrl", url).then(url => {
|
||||
$A.Electron.sendMessage('openWebTabWindow', {url})
|
||||
})
|
||||
$A.Electron.sendMessage('openWebTabWindow', {url})
|
||||
},
|
||||
|
||||
/** *****************************************************************************************/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user