|
|
@@ -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);
|
|
|
})
|
|
|
},
|