From 4c237064d8e534e61c677f30f8c779c43fe28b9a Mon Sep 17 00:00:00 2001 From: ZiuChen <457353192@qq.com> Date: Mon, 15 Aug 2022 21:03:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20v1.0.2=20=E4=BF=AE=E5=A4=8DMac=E4=B8=8B?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E5=86=99=E5=85=A5=E6=95=B0=E6=8D=AE=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- public/plugin.json | 2 +- public/preload.js | 8 +++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 1854d41..f149598 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "clipboard-manager", - "version": "1.0.1", + "version": "1.0.2", "private": true, "scripts": { "serve": "vue-cli-service serve", diff --git a/public/plugin.json b/public/plugin.json index 794990a..dc1a06e 100644 --- a/public/plugin.json +++ b/public/plugin.json @@ -1,5 +1,5 @@ { - "version": "1.0.1", + "version": "1.0.2", "pluginName": "剪贴板", "description": "强大的剪贴板管理工具", "author": "ZiuChen", diff --git a/public/preload.js b/public/preload.js index c5bfbaa..0583312 100644 --- a/public/preload.js +++ b/public/preload.js @@ -1,7 +1,7 @@ // /* // name: clipboard_manager // author: Github @ZiuChen -// lastUpdate: v1.0.1 2022/08/15 +// lastUpdate: v1.0.2 2022/08/15 // desc: 监听剪贴板 读写本地文件 // */ @@ -10,7 +10,8 @@ const crypto = require('crypto') const { clipboard } = require('electron') const nativeImage = require('electron').nativeImage -const home = utools.getPath('home') +const homePath = utools.getPath('home') +const userDataPath = utools.getPath('userData') const dbName = '_utools_clipboard_manager_storage' class DB { @@ -172,7 +173,8 @@ const paste = () => { } } -const path = `${home}\\${dbName}` +const isMacOs = utools.isMacOs() +const path = `${isMacOs ? userDataPath : homePath}\\${dbName}` const db = new DB(path) db.init()