mirror of
https://github.com/kuaifan/dootask.git
synced 2026-03-17 19:23:26 +00:00
fix: 客户端提交截图空格报错的问题
This commit is contained in:
parent
f4a7b8e2bb
commit
4b90086e5a
5
resources/assets/js/app.js
vendored
5
resources/assets/js/app.js
vendored
@ -169,14 +169,15 @@ $A.execMainCacheJudge = (key) => {
|
|||||||
// 绑定截图快捷键
|
// 绑定截图快捷键
|
||||||
$A.bindScreenshotKey = (data) => {
|
$A.bindScreenshotKey = (data) => {
|
||||||
let key = "";
|
let key = "";
|
||||||
if (data.screenshot_key && (data.screenshot_mate || data.screenshot_shift)) {
|
let screenshot_key = (data.screenshot_key || "").trim().toLowerCase()
|
||||||
|
if (screenshot_key && (data.screenshot_mate || data.screenshot_shift)) {
|
||||||
if (data.screenshot_mate) {
|
if (data.screenshot_mate) {
|
||||||
key = /macintosh|mac os x/i.test(navigator.userAgent) ? 'command' : 'ctrl'
|
key = /macintosh|mac os x/i.test(navigator.userAgent) ? 'command' : 'ctrl'
|
||||||
}
|
}
|
||||||
if (data.screenshot_shift) {
|
if (data.screenshot_shift) {
|
||||||
key = `${key ? `${key}+` : ''}shift`
|
key = `${key ? `${key}+` : ''}shift`
|
||||||
}
|
}
|
||||||
key = `${key}+${data.screenshot_key.toLowerCase()}`
|
key = `${key}+${screenshot_key.toLowerCase()}`
|
||||||
}
|
}
|
||||||
$A.Electron.sendMessage('bindScreenshotKey', {key});
|
$A.Electron.sendMessage('bindScreenshotKey', {key});
|
||||||
};
|
};
|
||||||
|
|||||||
@ -74,7 +74,7 @@ export default {
|
|||||||
|
|
||||||
onKeydown({key, keyCode}) {
|
onKeydown({key, keyCode}) {
|
||||||
if (keyCode !== 8) {
|
if (keyCode !== 8) {
|
||||||
key = key && key.length === 1 ? key.toUpperCase() : ""
|
key = key && key.length === 1 ? key.trim().toUpperCase() : ""
|
||||||
if (key) {
|
if (key) {
|
||||||
this.formData.screenshot_key = key
|
this.formData.screenshot_key = key
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user