新增启动参数 search

This commit is contained in:
lyswhut
2020-03-02 15:57:26 +08:00
parent 4533f7b1d5
commit 53f5c168ad
2 changed files with 24 additions and 12 deletions
+23 -12
View File
@@ -112,18 +112,8 @@ export default {
...mapMutations('download', ['updateDownloadList']),
...mapMutations(['setSetting']),
init() {
rendererInvoke('getEnvParams').then(envParams => {
this.envParams = envParams
this.isNt = isLinux || this.envParams.nt
if (this.isNt) {
document.body.classList.remove('transparent')
document.body.classList.add('noTransparent')
}
if (this.isProd && !this.isNt) {
document.body.addEventListener('mouseenter', this.dieableIgnoreMouseEvents)
document.body.addEventListener('mouseleave', this.enableIgnoreMouseEvents)
}
})
rendererInvoke('getEnvParams').then(this.handleEnvParamsInit)
document.body.addEventListener('click', this.handleBodyClick, true)
rendererOn('update-available', (e, info) => {
// this.showUpdateModal(true)
@@ -259,6 +249,27 @@ export default {
event.preventDefault()
if (/^https?:\/\//.test(event.target.href)) openUrl(event.target.href)
},
handleEnvParamsInit(envParams) {
this.envParams = envParams
this.isNt = isLinux || this.envParams.nt
if (this.isNt) {
document.body.classList.remove('transparent')
document.body.classList.add('noTransparent')
}
if (this.isProd && !this.isNt) {
document.body.addEventListener('mouseenter', this.dieableIgnoreMouseEvents)
document.body.addEventListener('mouseleave', this.enableIgnoreMouseEvents)
}
if (this.envParams.search != null) {
this.$router.push({
path: 'search',
query: {
text: this.envParams.search,
},
})
}
},
},
beforeDestroy() {
this.clearUpdateTimeout()