vue updater

This commit is contained in:
gaoshuaixing
2022-02-22 21:56:15 +08:00
parent af4fed2c47
commit 78dcebcfff
3 changed files with 6 additions and 13 deletions

View File

@@ -12,7 +12,6 @@ export default {
return {};
},
watch: {},
mounted () {},
methods: {}
}
</script>

View File

@@ -87,7 +87,7 @@ export default {
'menu_412' : {
icon: 'profile',
title: '自动更新',
pageName: 'DemoUpdaterIndex',
pageName: 'BaseUpdaterIndex',
params: {}
},
'menu_500' : {
@@ -96,12 +96,6 @@ export default {
pageName: 'BaseSoftwareIndex',
params: {}
},
'menu_600' : {
icon: 'profile',
title: '系统',
pageName: 'BaseSystemIndex',
params: {}
},
'menu_900' : {
icon: 'profile',
title: '测试',

View File

@@ -25,6 +25,7 @@
</div>
</template>
<script>
import { ipcApiRoute, specialIpcRoute } from '@/api/main'
export default {
data() {
@@ -40,7 +41,8 @@ export default {
methods: {
init () {
const self = this;
self.$ipc.on('app.updater', (event, result) => {
this.$ipc.removeAllListeners(specialIpcRoute.appUpdater);
this.$ipc.on(specialIpcRoute.appUpdater, (event, result) => {
result = JSON.parse(result);
self.status = result.status;
if (result.status == 3) {
@@ -52,8 +54,7 @@ export default {
})
},
checkForUpdater () {
const self = this;
self.$ipcCallMain('example.checkForUpdater').then(r => {
this.$ipcCall(ipcApiRoute.checkForUpdater).then(r => {
console.log(r);
})
},
@@ -62,8 +63,7 @@ export default {
this.$message.info('没有可用版本');
return
}
const self = this;
self.$ipcCallMain('example.downloadApp').then(r => {
this.$ipcCall(ipcApiRoute.downloadApp).then(r => {
console.log(r);
})
},