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()