utils.js 1014 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. 'use strict';
  2. const { Controller } = require('ee-core');
  3. const { shell } = require('electron');
  4. const Log = require('ee-core/log');
  5. const autoUpdater = require('../addon/autoUpdater');
  6. /**
  7. * example
  8. * @class
  9. */
  10. class UtilsController extends Controller {
  11. constructor(ctx) {
  12. super(ctx);
  13. }
  14. /**
  15. * 所有方法接收两个参数
  16. * @param args 前端传的参数
  17. * @param event - ipc通信时才有值。详情见:控制器文档
  18. */
  19. /**
  20. * upload
  21. */
  22. async openFileFolder (params) {
  23. // const result = await Services.get('example').test('electron');
  24. Log.info(params)
  25. Log.info(decodeURIComponent(params))
  26. // shell.openPath(params);
  27. }
  28. async shellFun (params) {
  29. // shell[params.action](params.params)
  30. }
  31. async checkUpdate () {
  32. let updaterAddon = new autoUpdater();
  33. updaterAddon.create();
  34. if(updaterAddon.checkUpdate()){
  35. return
  36. }
  37. }
  38. }
  39. UtilsController.toString = () => '[class ExampleController]';
  40. module.exports = UtilsController;