'use strict'; const { Controller } = require('ee-core'); const { shell } = require('electron'); const Log = require('ee-core/log'); const autoUpdater = require('../addon/autoUpdater'); /** * example * @class */ class UtilsController extends Controller { constructor(ctx) { super(ctx); } /** * 所有方法接收两个参数 * @param args 前端传的参数 * @param event - ipc通信时才有值。详情见:控制器文档 */ /** * upload */ async openFileFolder (params) { // const result = await Services.get('example').test('electron'); Log.info(params) Log.info(decodeURIComponent(params)) // shell.openPath(params); } async shellFun (params) { // shell[params.action](params.params) } async checkUpdate () { let updaterAddon = new autoUpdater(); updaterAddon.create(); if(updaterAddon.checkUpdate()){ return } } } UtilsController.toString = () => '[class ExampleController]'; module.exports = UtilsController;