소스 검색

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

MY 4 주 전
부모
커밋
fdfd89dda3
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  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) {