diff --git a/build/icon.icns b/build/icon.icns new file mode 100644 index 0000000..4f3b033 Binary files /dev/null and b/build/icon.icns differ diff --git a/build/icon.ico b/build/icon.ico new file mode 100644 index 0000000..2922443 Binary files /dev/null and b/build/icon.ico differ diff --git a/build/icon.png b/build/icon.png new file mode 100644 index 0000000..47fdfde Binary files /dev/null and b/build/icon.png differ diff --git a/build/icons/mac/icon.icns b/build/icons/mac/icon.icns new file mode 100644 index 0000000..4f3b033 Binary files /dev/null and b/build/icons/mac/icon.icns differ diff --git a/build/icons/png/1024x1024.png b/build/icons/png/1024x1024.png new file mode 100644 index 0000000..b3abc89 Binary files /dev/null and b/build/icons/png/1024x1024.png differ diff --git a/build/icons/png/128x128.png b/build/icons/png/128x128.png new file mode 100644 index 0000000..37dec25 Binary files /dev/null and b/build/icons/png/128x128.png differ diff --git a/build/icons/png/16x16.png b/build/icons/png/16x16.png new file mode 100644 index 0000000..101378f Binary files /dev/null and b/build/icons/png/16x16.png differ diff --git a/build/icons/png/24x24.png b/build/icons/png/24x24.png new file mode 100644 index 0000000..d321c4a Binary files /dev/null and b/build/icons/png/24x24.png differ diff --git a/build/icons/png/256x256.png b/build/icons/png/256x256.png new file mode 100644 index 0000000..97dfbcd Binary files /dev/null and b/build/icons/png/256x256.png differ diff --git a/build/icons/png/32x32.png b/build/icons/png/32x32.png new file mode 100644 index 0000000..2d5fdaf Binary files /dev/null and b/build/icons/png/32x32.png differ diff --git a/build/icons/png/48x48.png b/build/icons/png/48x48.png new file mode 100644 index 0000000..6a24661 Binary files /dev/null and b/build/icons/png/48x48.png differ diff --git a/build/icons/png/512x512.png b/build/icons/png/512x512.png new file mode 100644 index 0000000..6788d6e Binary files /dev/null and b/build/icons/png/512x512.png differ diff --git a/build/icons/png/64x64.png b/build/icons/png/64x64.png new file mode 100644 index 0000000..56fc9fe Binary files /dev/null and b/build/icons/png/64x64.png differ diff --git a/build/icons/win/icon.ico b/build/icons/win/icon.ico new file mode 100644 index 0000000..2922443 Binary files /dev/null and b/build/icons/win/icon.ico differ diff --git a/package.json b/package.json index a9a323a..dc24e83 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,8 @@ "postinstall": "electron-builder install-app-deps", "postuninstall": "electron-builder install-app-deps" }, + "author": "Kuari", + "license": "GPL", "main": "background.js", "dependencies": { "@element-plus/icons-vue": "^0.2.4", diff --git a/src/background.ts b/src/background.ts index 9f1561d..95f3e19 100644 --- a/src/background.ts +++ b/src/background.ts @@ -38,6 +38,13 @@ async function createWindow () { } } +// 避免开启多个客户端窗口 +const gotTheLock = app.requestSingleInstanceLock() + +if (!gotTheLock) { + app.quit() +} + // Quit when all windows are closed. app.on('window-all-closed', () => { // On macOS it is common for applications and their menu bar diff --git a/src/router/index.ts b/src/router/index.ts index 699d327..0a15bd8 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,4 +1,4 @@ -import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router' +import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router' const routes: Array = [ { @@ -9,7 +9,7 @@ const routes: Array = [ ] const router = createRouter({ - history: createWebHistory(process.env.BASE_URL), + history: createWebHashHistory(process.env.BASE_URL), routes }) diff --git a/src/views/keyTab/index.vue b/src/views/keyTab/index.vue index fbe3239..25596ed 100644 --- a/src/views/keyTab/index.vue +++ b/src/views/keyTab/index.vue @@ -6,7 +6,7 @@ @tab-remove="removeTab" editable @edit="handleTabEdit" - style="width: calc(100vw - 680px);user-select: none;" + style="width: calc(100vw - 680px);" > diff --git a/vue.config.js b/vue.config.js index c1f24df..255e04e 100644 --- a/vue.config.js +++ b/vue.config.js @@ -4,6 +4,7 @@ const Components = require('unplugin-vue-components/webpack') const { ElementPlusResolver } = require('unplugin-vue-components/resolvers') module.exports = { + productionSourceMap: false, chainWebpack: config => { config.module.rule('pug') .test(/\.pug$/) @@ -22,7 +23,53 @@ module.exports = { electronBuilder: { nodeIntegration: true, disableMainProcessTypescript: false, - mainProcessTypeChecking: false + mainProcessTypeChecking: false, + build: { + productName: 'MyRedisDesktopManager', + appId: 'com.MyRedisDesktopManager.client', + copyright: '© Kuari 2022', + nsis: { + oneClick: false, + allowElevation: true, + allowToChangeInstallationDirectory: true, + installerIcon: 'build/icon.ico', + uninstallerIcon: 'build/icon.ico', + installerHeaderIcon: 'build/icon.ico', + createDesktopShortcut: true, + createStartMenuShortcut: true, + shortcutName: 'MyRedisDesktopManager' + }, + win: { + icon: 'build/icon.ico', + requestedExecutionLevel: 'requireAdministrator', + target: [ + { + target: 'nsis' + } + ] + }, + dmg: { + contents: [ + { + x: 410, + y: 150, + type: 'link', + path: '/Applications' + }, + { + x: 130, + y: 150, + type: 'file' + } + ] + }, + mac: { + icon: 'build/icon.icns' + }, + linux: { + icon: 'build/icon.ico' + } + } } } }