修复复制一键安装命令失败的问题
This commit is contained in:
1 parent
be0c74015a
commit
45f9c3e2b1
3 files changed
+4
-2
No files matched your search
@@ -17,6 +17,7 @@
|
||||
"@tanstack/react-query": "^5.90.6",
|
||||
"@types/qs": "^6.14.0",
|
||||
"antd": "^5.27.4",
|
||||
"copy-to-clipboard": "^3.3.3",
|
||||
"dayjs": "^1.11.18",
|
||||
"lucide-react": "^0.545.0",
|
||||
"qs": "^6.14.0",
|
||||
|
||||
@@ -8,6 +8,7 @@ import linuxPng from '../../assets/os/linux.png';
|
||||
import applePng from '../../assets/os/apple.png';
|
||||
import windowsPng from '../../assets/os/win11.png';
|
||||
import {useNavigate} from "react-router-dom";
|
||||
import copy from 'copy-to-clipboard';
|
||||
|
||||
const {Paragraph, Text} = Typography;
|
||||
const {TabPane} = Tabs;
|
||||
@@ -123,7 +124,7 @@ const AgentInstall = () => {
|
||||
// 复制到剪贴板
|
||||
const copyToClipboard = useCallback(async (text: string) => {
|
||||
try {
|
||||
await navigator.clipboard.writeText(text);
|
||||
copy(text);
|
||||
message.success('已复制到剪贴板');
|
||||
} catch (error) {
|
||||
console.error('Failed to copy:', error);
|
||||
|
||||
+1
-1
@@ -1874,7 +1874,7 @@ cookie@^1.0.1:
|
||||
|
||||
copy-to-clipboard@^3.3.3:
|
||||
version "3.3.3"
|
||||
resolved "https://registry.npmjs.org/copy-to-clipboard/-/copy-to-clipboard-3.3.3.tgz"
|
||||
resolved "https://registry.yarnpkg.com/copy-to-clipboard/-/copy-to-clipboard-3.3.3.tgz#55ac43a1db8ae639a4bd99511c148cdd1b83a1b0"
|
||||
integrity sha512-2KV8NhB5JqC3ky0r9PMCAZKbUHSwtEo4CwCs0KXgruG43gX5PMqDEBbVU4OUzw2MuAWUfsuFmWvEKG5QRfSnJA==
|
||||
dependencies:
|
||||
toggle-selection "^1.0.6"
|
||||
|
||||
Reference in new issue
Block a user