Compare commits

...

No commits in common. 'main' and 'master' have entirely different histories.
main ... master

  1. 1
      .github/CODEOWNERS
  2. 9
      .github/dependabot.yml
  3. 29
      .github/workflows/add-to-project.yml
  4. 4
      .gitignore
  5. 6
      .idea/misc.xml
  6. 16
      main.js
  7. 2
      package.json

1
.github/CODEOWNERS

@ -1 +0,0 @@
* @electron/wg-ecosystem

9
.github/dependabot.yml

@ -1,9 +0,0 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
time: "13:00"
open-pull-requests-limit: 99
versioning-strategy: increase

29
.github/workflows/add-to-project.yml

@ -1,29 +0,0 @@
name: Add to Ecosystem WG Project
on:
issues:
types:
- opened
pull_request_target:
types:
- opened
permissions: {}
jobs:
add-to-project:
runs-on: ubuntu-latest
steps:
- name: Generate GitHub App token
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
id: generate-token
with:
creds: ${{ secrets.ECOSYSTEM_ISSUE_TRIAGE_GH_APP_CREDS }}
org: electron
- name: Add to Project
uses: dsanders11/project-actions/add-item@3a81985616963f32fae17d1d1b406c631f3201a1 # v1.1.0
with:
field: Opened
field-value: ${{ github.event.pull_request.created_at || github.event.issue.created_at }}
project-number: 89
token: ${{ steps.generate-token.outputs.token }}

4
.gitignore

@ -1,5 +1 @@
node_modules
dist/
out/
*.lock

6
.idea/misc.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

16
main.js

@ -1,5 +1,5 @@
// Modules to control application life and create native browser window
const { app, BrowserWindow ,dialog, globalShortcut} = require('electron')
const { app, BrowserWindow ,dialog} = require('electron')
const { execSync } = require('child_process');
const path = require('node:path')
@ -11,7 +11,6 @@ function createWindow () {
// frame: false,
icon: path.join(__dirname, 'icon.ico'),
webPreferences: {
contextIsolation: false,
preload: path.join(__dirname, 'preload.js'),
webSecurity: false, // 允许跨域
}
@ -22,7 +21,6 @@ function createWindow () {
//mainWindow.loadFile('index.html')
// window.isElectron = true;
mainWindow.loadFile('./dist/index.html')
// mainWindow.loadURL('http://localhost:8888/')
// Open the DevTools.
// mainWindow.webContents.openDevTools()
@ -48,16 +46,6 @@ function createWindow () {
mainWindow.on('closed', () => {
app.quit() // 关闭应用程序
})
// 注册快捷键
// mainWindow.on('focus', () => {
// globalShortcut.register('CommandOrControl+Alt+F', function () {
// mainWindow && mainWindow.webContents.toggleDevTools()
// })
// })
// mainWindow.on('blur', () => {
// globalShortcut.unregisterAll() // 注销键盘事件
// })
}
/**
@ -65,7 +53,7 @@ function createWindow () {
 */
function clearCache(mainWindow) {
// 在窗口即将关闭时清除 localStorage 和 sessionStorage
mainWindow.webContents.executeJavaScript('localStorage.removeItem("Admin-Token");')
mainWindow.webContents.executeJavaScript('localStorage.clear();')
mainWindow.webContents.executeJavaScript('sessionStorage.clear();')
}
// This method will be called when Electron has finished

2
package.json

@ -5,7 +5,7 @@
"main": "main.js",
"scripts": {
"start": "electron .",
"packager": "electron-packager ./ cas-w --platform=win32 --arch=x64 --download.mirrorOptions.mirror=https://npmmirror.com/mirrors/electron/ --overwrite --icon=./icon.ico --out=./out"
"packager": "electron-packager ./ cas-w --platform=win32 --arch=x64 --overwrite --icon=./icon.ico --out=./out"
},
"win": {

Loading…
Cancel
Save