@@ -151,9 +151,9 @@ state.custom = perf.custom || {};
const userInfo = ref(window.rubick.dbStorage.getItem('rubick-user-info'));
-service.getUserInfo({ openId: userInfo.value.openId }).then((res) => {
- userInfo.value = res;
-});
+// service.getUserInfo({ openId: userInfo.value.openId }).then((res) => {
+// userInfo.value = res;
+// });
const setConfig = debounce(() => {
remote.getGlobal('OP_CONFIG').set(
diff --git a/feature/src/views/settings/user.vue b/feature/src/views/settings/user.vue
index 5c52e7b..f1ef4ee 100644
--- a/feature/src/views/settings/user.vue
+++ b/feature/src/views/settings/user.vue
@@ -1,17 +1,18 @@
-
-
-
- 使用微信小程序登录
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
",
"private": true,
"scripts": {
@@ -30,6 +30,7 @@
"get-mac-apps": "^1.0.2",
"got": "^11.8.3",
"lodash.throttle": "^4.1.1",
+ "node-key-sender": "^1.0.11",
"pouchdb": "^7.2.2",
"vue": "^3.0.0",
"vue-router": "^4.0.0-0",
diff --git a/public/PrScrn.dll b/public/PrScrn.dll
deleted file mode 100644
index 85695cd..0000000
Binary files a/public/PrScrn.dll and /dev/null differ
diff --git a/public/PrintScr.exe b/public/PrintScr.exe
deleted file mode 100644
index fb2fa70..0000000
Binary files a/public/PrintScr.exe and /dev/null differ
diff --git a/public/ScreenCapture.exe b/public/ScreenCapture.exe
new file mode 100644
index 0000000..f90f348
Binary files /dev/null and b/public/ScreenCapture.exe differ
diff --git a/public/feature/package.json b/public/feature/package.json
index 9dfe322..dfd9c7c 100644
--- a/public/feature/package.json
+++ b/public/feature/package.json
@@ -3,7 +3,7 @@
"pluginName": "rubick 系统菜单",
"description": "rubick 系统菜单",
"main": "index.html",
- "logo": "https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/acb761082f4a4b46847e7cd8b180f63c~tplv-k3u1fbpfcp-watermark.image",
+ "logo": "https://pic1.zhimg.com/80/v2-c09780808301668a82e6646cb42f0806_720w.png",
"version": "0.0.0",
"preload":"preload.js",
"pluginType": "ui",
diff --git a/public/preload.js b/public/preload.js
index 894c784..96ac19d 100644
--- a/public/preload.js
+++ b/public/preload.js
@@ -162,8 +162,16 @@ window.rubick = {
shellBeep: () => {
ipcSend('shellBeep');
},
-
+
getFileIcon: (path) => {
return ipcSendSync('getFileIcon', { path });
},
+
+ getCopyedFiles: () => {
+ return ipcSendSync('getCopyFiles');
+ },
+
+ simulateKeyboardTap: (key, ...modifier) => {
+ ipcSend('simulateKeyboardTap', { key, modifier });
+ },
};
diff --git a/src/core/plugin-handler/index.ts b/src/core/plugin-handler/index.ts
index 3719815..36874bf 100644
--- a/src/core/plugin-handler/index.ts
+++ b/src/core/plugin-handler/index.ts
@@ -52,7 +52,7 @@ class AdapterHandler {
} catch (e) {
// ignore
}
- this.registry = register || 'https://registry.npm.taobao.org';
+ this.registry = register || 'https://registry.npmmirror.com/';
}
async upgrade(name: string): Promise {
@@ -150,27 +150,21 @@ class AdapterHandler {
}
return adapters;
}
- private cleanCache() {
- spawn('npm', ['cache', 'clean', '-f'], {
- cwd: this.baseDir,
- });
- }
/**
* 运行包管理器
* @memberof AdapterHandler
*/
private async execCommand(cmd: string, modules: string[]): Promise {
- this.cleanCache();
return new Promise((resolve: any, reject: any) => {
- let args: string[] = [cmd]
+ const args: string[] = [cmd]
.concat(
cmd !== 'uninstall' ? modules.map((m) => `${m}@latest`) : modules
)
.concat('--color=always')
- .concat('--save');
- if (cmd !== 'uninstall')
- args = args.concat(`--registry=${this.registry}`);
+ .concat('--save')
+ .concat(`--registry=${this.registry}`);
+
const npm = spawn('npm', args, {
cwd: this.baseDir,
});
diff --git a/src/core/screen-capture/index.ts b/src/core/screen-capture/index.ts
index 21b9e7b..913d2e7 100644
--- a/src/core/screen-capture/index.ts
+++ b/src/core/screen-capture/index.ts
@@ -5,7 +5,7 @@ import path from 'path';
// 截图方法windows
export const screenWindow = (cb) => {
- const url = path.resolve(__static, 'PrintScr.exe');
+ const url = path.resolve(__static, 'ScreenCapture.exe');
const screen_window = execFile(url);
screen_window.on('exit', (code) => {
if (code) {
diff --git a/src/main/common/api.ts b/src/main/common/api.ts
index 4efc1ed..5ed9f7e 100644
--- a/src/main/common/api.ts
+++ b/src/main/common/api.ts
@@ -13,7 +13,11 @@ import { runner, detach } from '../browsers';
import fs from 'fs';
import { LocalDb, screenCapture } from '@/core';
import plist from 'plist';
+import ks from 'node-key-sender';
+
import { DECODE_KEY } from '@/common/constans/main';
+import getCopyFiles from '@/common/utils/getCopyFiles';
+
import mainInstance from '../index';
const runnerInstance = runner();
const detachInstance = detach();
@@ -324,6 +328,20 @@ class API {
});
});
}
+
+ public getCopyFiles() {
+ return getCopyFiles();
+ }
+
+ public simulateKeyboardTap({ data: { key, modifier } }) {
+ let keys = [key.toLowerCase()];
+ if (modifier && Array.isArray(modifier) && modifier.length > 0) {
+ keys = modifier.concat(keys);
+ ks.sendCombination(keys);
+ } else {
+ ks.sendKeys(keys);
+ }
+ }
}
export default new API();
diff --git a/yarn.lock b/yarn.lock
index 7e1ee82..8f5816f 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -8070,6 +8070,11 @@ node-gyp-build@~4.1.0:
resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.1.1.tgz#d7270b5d86717068d114cc57fff352f96d745feb"
integrity sha512-dSq1xmcPDKPZ2EED2S6zw/b9NKsqzXRE6dVr8TVQnI3FJOTteUMuqF3Qqs6LZg+mLGYJWqQzMbIjMtJqTv87nQ==
+node-key-sender@^1.0.11:
+ version "1.0.11"
+ resolved "https://registry.npmmirror.com/node-key-sender/-/node-key-sender-1.0.11.tgz#93210f07163607d8daf2874f1a29567d0acdb94c"
+ integrity sha512-vv2IXd8QdZBFYXaIy02uy2rK6EKj+tOTEuoTxJKS9l8zw8Cz6DeLffR8ompj7N2A3h6XK7aiy+YAcTaeOqwp2Q==
+
node-libs-browser@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.2.1.tgz#b64f513d18338625f90346d27b0d235e631f6425"