浏览代码

vue updater

gaoshuaixing 3 年之前
父节点
当前提交
78dcebcfff
共有 3 个文件被更改,包括 6 次插入13 次删除
  1. 0 1
      frontend/src/App.vue
  2. 1 7
      frontend/src/layouts/Menu.vue
  3. 5 5
      frontend/src/views/base/updater/Index.vue

+ 0 - 1
frontend/src/App.vue

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

+ 1 - 7
frontend/src/layouts/Menu.vue

@@ -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: '测试',

+ 5 - 5
frontend/src/views/base/updater/Index.vue

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