text: import { app, BrowserWindow } from 'electron';
  
  let mainWindow = null;
  
  if (process.env.NODE_ENV === 'production') {
    const sourceMapSupport = require('source-map-support');
    sourceMapSupport.install();
  }
  
  if (
    process.env.NODE_ENV === 'development' ||
    process.env.DEBUG_PROD === 'true'
  ) {
    require('electron-debug')();
    const path = require('path');
    const p = path.join(__dirname, '..', 'app', 'node_modules');
    require('module').globalPaths.push(p);
  }
  
  const installExtensions = async () => {
    const installer = require('electron-devtools-installer');
    const forceDownload = !!process.env.UPGRADE_EXTENSIONS;
    const extensions = ['REACT_DEVELOPER_TOOLS'];
  
    return Promise.all(
      extensions.map(name => installer.default(installer[name], forceDownload))
    ).catch(console.log);
  };
  
  /**
   * Add event listeners...
   */
  
  app.on('window-all-closed', () => {
    // Respect the OSX convention of having the application in memory even
    // after all windows have been closed
    if (process.platform !== 'darwin') {
      app.quit();
    }
  });
  
  app.on('ready', async () => {
    if (
      process.env.NODE_ENV === 'development' ||
      process.env.DEBUG_PROD === 'true'
    ) {
      await installExtensions();
    }
  
    mainWindow = new BrowserWindow({
      show: false,
      width: 800,
      height: 600,
      title: "管理学院资助信息管理系统",
    });
    //
    // mainWindow = Splashscreen.initSplashScreen({
    //   windowOpts: {
    //     show: false,
    //     width: 800,
    //     height: 600,
    //     title: "管理学院资助信息管理系统",
    //   },
    //   templateUrl: `file://${__dirname}/splash-screen.html`,
    //   splashScreenOpts: {
    //     width: 425,
    //     height: 325,
    //   },
    // });
  
    mainWindow.loadURL(`file://${__dirname}/app.html`);
  
    // @TODO: Use 'ready-to-show' event
    //        https://github.com/electron/electron/blob/master/docs/api/browser-window.md#using-ready-to-show-event
    mainWindow.webContents.on('did-finish-load', () => {
      if (!mainWindow) {
        throw new Error('"mainWindow" is not defined');
      }
      mainWindow.show();
      mainWindow.focus();
    });
  
    mainWindow.on('closed', () => {
      mainWindow = null;
    });
  });
  
  import "./main/db"
  import "./main/message"
  