From c4cdce46c25d03c28e3b251def22ed3ac91e50e8 Mon Sep 17 00:00:00 2001 From: topkill Date: Sat, 25 Apr 2026 19:19:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(webui):=20=E6=9B=BF=E6=8D=A2uuid=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=EF=BC=8C=E8=A7=A3=E5=86=B3http=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E4=B8=8B=E6=97=A0=E6=B3=95=E7=94=9F=E6=88=90=E5=AF=86=E9=92=A5?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原生的`crypto.randomUUID()`只支持https和localhost的安全上下文环境。 --- webui/package-lock.json | 16 +++++++++++++++- webui/package.json | 3 ++- webui/src/features/account/AddKeyModal.jsx | 3 ++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/webui/package-lock.json b/webui/package-lock.json index 55ac557..63f1eed 100644 --- a/webui/package-lock.json +++ b/webui/package-lock.json @@ -13,7 +13,8 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "react-router-dom": "^7.13.0", - "tailwind-merge": "^3.4.0" + "tailwind-merge": "^3.4.0", + "uuid": "^14.0.0" }, "devDependencies": { "@vitejs/plugin-react": "^6.0.1", @@ -2021,6 +2022,19 @@ "dev": true, "license": "MIT" }, + "node_modules/uuid": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-14.0.0.tgz", + "integrity": "sha512-Qo+uWgilfSmAhXCMav1uYFynlQO7fMFiMVZsQqZRMIXp0O7rR7qjkj+cPvBHLgBqi960QCoo/PH2/6ZtVqKvrg==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist-node/bin/uuid" + } + }, "node_modules/vite": { "version": "8.0.5", "resolved": "https://registry.npmjs.org/vite/-/vite-8.0.5.tgz", diff --git a/webui/package.json b/webui/package.json index 3f41ca9..bc69afb 100644 --- a/webui/package.json +++ b/webui/package.json @@ -14,7 +14,8 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "react-router-dom": "^7.13.0", - "tailwind-merge": "^3.4.0" + "tailwind-merge": "^3.4.0", + "uuid": "^14.0.0" }, "devDependencies": { "@vitejs/plugin-react": "^6.0.1", diff --git a/webui/src/features/account/AddKeyModal.jsx b/webui/src/features/account/AddKeyModal.jsx index 875101a..061a1a5 100644 --- a/webui/src/features/account/AddKeyModal.jsx +++ b/webui/src/features/account/AddKeyModal.jsx @@ -1,4 +1,5 @@ import { X } from 'lucide-react' +import { v4 as uuidv4 } from 'uuid' export default function AddKeyModal({ show, t, editingKey, newKey, setNewKey, loading, onClose, onAdd }) { if (!show) { @@ -32,7 +33,7 @@ export default function AddKeyModal({ show, t, editingKey, newKey, setNewKey, lo {!isEditing && (