From 2f4156520e97abb7817d2c7a0c8c3b741a60056e Mon Sep 17 00:00:00 2001 From: Tianhao Shi Date: Tue, 28 Apr 2020 17:22:38 -0700 Subject: [PATCH] =?UTF-8?q?Mac=E4=B8=8BCommand+A=20=E4=B8=BA=E5=85=A8?= =?UTF-8?q?=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/component/FileManager/Explorer.js | 3 ++- src/untils/index.js | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/component/FileManager/Explorer.js b/src/component/FileManager/Explorer.js index a6a6626..4997059 100644 --- a/src/component/FileManager/Explorer.js +++ b/src/component/FileManager/Explorer.js @@ -17,6 +17,7 @@ import classNames from "classnames"; import ImgPreivew from "./ImgPreview"; import UpIcon from "@material-ui/icons/ArrowUpward"; import pathHelper from "../../untils/page"; +import { isMac } from "../../untils" import { withRouter } from "react-router-dom"; import { Table, @@ -179,7 +180,7 @@ class ExplorerCompoment extends Component { super(); this.keyMap = { DELETE_FILE: "del", - SELECT_ALL: "ctrl+a" + SELECT_ALL: `${isMac() ? 'command' : 'ctrl'}+a` }; this.handlers = { diff --git a/src/untils/index.js b/src/untils/index.js index 9f6c7ec..7a9b6f2 100644 --- a/src/untils/index.js +++ b/src/untils/index.js @@ -188,4 +188,8 @@ export function getNumber(base,conditions){ } }) return base +} + +export const isMac = () => { + return "MACINTEL" === navigator.platform.toUpperCase() } \ No newline at end of file