diff --git a/README.md b/README.md index 698fa78..811af62 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,6 @@ 钉钉桌面版,基于 electron 和钉钉网页版开发,支持 Windows、Linux 和 macOS -## 公司招人 - -招聘 react 技术栈的开发者,公司研发中心位于杭州,当前是北京团队招聘初级、中级和高级前端人员。高级或者中级工程师可培养为团队 leader,有带团队的经验加分,有意向的请私聊我,邮箱:diaocheng@outlook.com。 - ## 安装步骤 > 直接从[GitHub releases](https://github.com/nashaofu/dingtalk/releases/latest)页面下载最新版安装包即可 @@ -73,7 +69,7 @@ npm run pack 1. 支持屏幕截图,并且支持多显示器截图。截图快捷键为`ctrl+alt+a`,2017-10-23 2. 支持网络错误页面提示,网络恢复自动跳转到登陆页面,2017-12-28 3. 修改网络错误页面,支持快捷键设置,2018-02-07 -4. 更新截图功能,支持多显示器截图,目前确认支持 Ubuntu16,Ubuntu17 不支持,其他 Linux 系统未测试,其中使用了[shortcut-capture](https://github.com/nashaofu/shortcut-capture)模块来实现截图;修复设置页面不修改快捷键时,点击保存时提示错误的 BUG,2018-03-03 +4. 更新截图功能,支持多显示器截图,目前确认支持 Ubuntu16,Ubuntu17 不支持,其他 Linux 系统未测试,其中使用了[electron-screenshots](https://github.com/nashaofu/electron-screenshots)模块来实现截图;修复设置页面不修改快捷键时,点击保存时提示错误的 BUG,2018-03-03 5. 整个项目采用 webpack 打包,采用 electron-builder 来构建应用,分别构建生成三大平台安装包,2018-03-22 6. 添加关于页面,文件下载进度支持,消息提示不弹出问题修复,修复 Linux 更新问题,2018-04-01 7. 修复消息提示 node-notifier 图标显示问题,2018-04-07 diff --git a/package.json b/package.json index 1700a0d..36149be 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dingtalk", - "version": "2.1.1", + "version": "2.1.2", "description": "钉钉桌面版,基于electron和钉钉网页版开发,支持Windows、Linux和macOS", "author": "nashaofu ", "main": "dist/main.js", @@ -27,57 +27,57 @@ "Windows" ], "dependencies": { - "@babel/runtime": "^7.5.5", + "@babel/runtime": "^7.7.7", "axios": "^0.19.0", - "electron-updater": "^4.1.2", + "electron-screenshots": "^0.0.5", + "electron-updater": "^4.2.0", "lodash": "^4.17.15", "normalize.css": "^8.0.1", - "shortcut-capture": "^1.2.1", - "vue": "^2.6.10" + "vue": "^2.6.11" }, "devDependencies": { - "@babel/core": "^7.5.5", - "@babel/plugin-proposal-class-properties": "^7.5.5", - "@babel/plugin-proposal-export-default-from": "^7.5.2", - "@babel/plugin-transform-runtime": "^7.5.5", - "@babel/preset-env": "^7.5.5", - "autoprefixer": "^9.6.1", + "@babel/core": "^7.7.7", + "@babel/plugin-proposal-class-properties": "^7.7.4", + "@babel/plugin-proposal-export-default-from": "^7.7.4", + "@babel/plugin-transform-runtime": "^7.7.6", + "@babel/preset-env": "^7.7.7", + "autoprefixer": "^9.7.3", "babel-eslint": "^10.0.3", "babel-loader": "^8.0.6", - "chalk": "^2.4.2", - "css-loader": "^3.2.0", - "electron": "^5.0.10", + "chalk": "^3.0.0", + "css-loader": "^3.4.0", + "electron": "^6.1.7", "electron-builder": "^21.2.0", "electron-debug": "^3.0.1", "electron-dev-webpack-plugin": "^1.0.4", "electron-devtools-installer": "^2.2.4", - "eslint": "^6.2.2", - "eslint-config-standard": "^14.0.1", + "eslint": "^6.8.0", + "eslint-config-standard": "^14.1.0", "eslint-friendly-formatter": "^4.0.1", - "eslint-loader": "^3.0.0", - "eslint-plugin-import": "^2.18.2", - "eslint-plugin-node": "^9.1.0", + "eslint-loader": "^3.0.3", + "eslint-plugin-import": "^2.19.1", + "eslint-plugin-node": "^11.0.0", "eslint-plugin-promise": "^4.2.1", "eslint-plugin-standard": "^4.0.1", - "eslint-plugin-vue": "^5.2.3", - "file-loader": "^4.2.0", + "eslint-plugin-vue": "^6.0.2", + "file-loader": "^5.0.2", "friendly-errors-webpack-plugin": "^1.7.0", "html-webpack-plugin": "^3.2.0", "less": "^3.10.3", "less-loader": "^5.0.0", - "mini-css-extract-plugin": "^0.8.0", + "mini-css-extract-plugin": "^0.9.0", "postcss-loader": "^3.0.0", "pug": "^2.0.4", "pug-plain-loader": "^1.0.0", "registry-auth-token": "^4.0.0", "registry-url": "^5.1.0", - "url-loader": "^2.1.0", - "vue-loader": "^15.7.1", - "vue-template-compiler": "^2.6.10", - "webpack": "^4.39.3", - "webpack-cli": "^3.3.7", - "webpack-dev-server": "^3.8.0", - "webpack-merge": "^4.2.1" + "url-loader": "^3.0.0", + "vue-loader": "^15.8.3", + "vue-template-compiler": "^2.6.11", + "webpack": "^4.41.4", + "webpack-cli": "^3.3.10", + "webpack-dev-server": "^3.10.1", + "webpack-merge": "^4.2.2" }, "build": { "appId": "com.electron.dingtalk", @@ -122,21 +122,27 @@ "target": "AppImage", "arch": [ "x64", - "ia32" + "ia32", + "arm64", + "armv7l" ] }, { "target": "deb", "arch": [ "x64", - "ia32" + "ia32", + "arm64", + "armv7l" ] }, { "target": "rpm", "arch": [ "x64", - "ia32" + "ia32", + "arm64", + "armv7l" ] } ], diff --git a/screenshot/5.png b/screenshot/5.png index e1c4a9e..e67808b 100644 Binary files a/screenshot/5.png and b/screenshot/5.png differ diff --git a/src/main/dingtalk.js b/src/main/dingtalk.js index f4f7981..c8c253a 100644 --- a/src/main/dingtalk.js +++ b/src/main/dingtalk.js @@ -9,7 +9,7 @@ import aboutWin from './aboutWin' import shortcut from './shortcut' import settingWin from './settingWin' import DingtalkTray from './dingtalkTray' -import ShortcutCapture from 'shortcut-capture' +import Screenshots from 'electron-screenshots' export default class DingTalk { // app对象是否ready @@ -27,7 +27,7 @@ export default class DingTalk { // 关于窗口 $aboutWin = null // 截图对象 - $shortcutCapture = null + $screenshots = null // 网络情况,默认为null,必须等到页面报告状态 online = null // 默认配置 @@ -36,7 +36,7 @@ export default class DingTalk { enableCapture: true, enableFlicker: true, keymap: { - 'shortcut-capture': ['Control', 'Alt', 'A'] + 'screenshots-capture': ['Control', 'Alt', 'A'] } } @@ -48,7 +48,7 @@ export default class DingTalk { Menu.setApplicationMenu(null) this.initMainWin() this.initTray() - this.initShortcutCapture() + this.initScreenshots() this.initNotify() this.bindShortcut() }) @@ -93,8 +93,8 @@ export default class DingTalk { /** * 初始化截图 */ - initShortcutCapture () { - this.$shortcutCapture = new ShortcutCapture() + initScreenshots () { + this.$screenshots = new Screenshots() } /** @@ -167,9 +167,9 @@ export default class DingTalk { /** * 截图 */ - shortcutCapture () { - if (this.$shortcutCapture) { - this.$shortcutCapture.shortcutCapture() + screenshotsCapture () { + if (this.$screenshots) { + this.$screenshots.startCapture() } } diff --git a/src/main/dingtalkTray.js b/src/main/dingtalkTray.js index 51cea3c..8df43e4 100644 --- a/src/main/dingtalkTray.js +++ b/src/main/dingtalkTray.js @@ -56,7 +56,7 @@ export default class DingtalkTray { if (this._dingtalk.setting.enableCapture) { menu.splice(1, 0, { label: '屏幕截图', - click: () => this._dingtalk.shortcutCapture() + click: () => this._dingtalk.screenshotsCapture() }) } diff --git a/src/main/setting.js b/src/main/setting.js index 27be8e3..136c7d7 100644 --- a/src/main/setting.js +++ b/src/main/setting.js @@ -31,8 +31,8 @@ export const readSetting = dingtalk => () => { if (err) return reject(err) try { const setting = JSON.parse(data) - if (typeof setting.keymap['shortcut-capture'] === 'string') { - setting.keymap['shortcut-capture'] = setting.keymap['shortcut-capture'].split('+') + if (typeof setting.keymap['screenshots-capture'] === 'string') { + setting.keymap['screenshots-capture'] = setting.keymap['screenshots-capture'].split('+') } resolve({ ...dingtalk.setting, ...setting }) } catch (e) { diff --git a/src/main/shortcut.js b/src/main/shortcut.js index 55b64d6..1e0eb6d 100644 --- a/src/main/shortcut.js +++ b/src/main/shortcut.js @@ -2,11 +2,11 @@ import { globalShortcut } from 'electron' export default dingtalk => () => { const actions = { - 'shortcut-capture': () => dingtalk.shortcutCapture() + 'screenshots-capture': () => dingtalk.screenshotsCapture() } const keymap = dingtalk.setting.keymap - if (!dingtalk.setting.enableCapture) delete actions['shortcut-capture'] + if (!dingtalk.setting.enableCapture) delete actions['screenshots-capture'] // 注销所有的快捷键 globalShortcut.unregisterAll() diff --git a/src/preload/mainWin/open.js b/src/preload/mainWin/open.js index 3f75ef1..ffe0cd7 100644 --- a/src/preload/mainWin/open.js +++ b/src/preload/mainWin/open.js @@ -7,12 +7,30 @@ export default injector => { iframe.style.display = 'none' document.body.append(iframe) - window.open = function (url, ...args) { + function download (url) { if (url.indexOf('https://space.dingtalk.com/auth/download') === 0) { iframe.src = url + return true } else if (url.indexOf('https://space.dingtalk.com/attachment') === 0) { iframe.src = url + return true + } + } + + document.addEventListener('click', e => { + for (let i = 0, length = e.path.length; i < length; i++) { + const node = e.path[i] + if (node.nodeName === 'A' && node.href) { + if (download(node.href)) { + e.preventDefault() + return + } + } } + }) + + window.open = function (url, ...args) { + download(url) return op.call(window, url, ...args) } } diff --git a/src/renderer/aboutWin/App.vue b/src/renderer/aboutWin/App.vue index 10fe3aa..74eace0 100644 --- a/src/renderer/aboutWin/App.vue +++ b/src/renderer/aboutWin/App.vue @@ -1,7 +1,7 @@