Browse Source

1、修复crypto.randomUUID()丢失导致无法复制配置值问题

MY 4 weeks ago
parent
commit
fdfd89dda3
1 changed files with 2 additions and 1 deletions
  1. 2 1
      JLHWEB/src/stores/modules/copy.ts

+ 2 - 1
JLHWEB/src/stores/modules/copy.ts

@@ -1,5 +1,6 @@
 import { defineStore } from "pinia";
 import piniaPersistConfig from "@/config/piniaPersist";
+import { generateUUID } from "@/utils";
 
 type ClipboardItem<T = any> = {
   key?: string;
@@ -26,7 +27,7 @@ export const useClipboardStore = defineStore("clipboard", {
         id?: string;
       } = {}
     ) {
-      const { key = "default", id = crypto.randomUUID() } = options;
+      const { key = "default", id = generateUUID() } = options;
 
       // 自动清理旧记录
       if (this.items.length >= this.maxHistory) {