diff --git a/src/utils/commons.js b/src/utils/commons.js index b7ab611..9b2b7c3 100644 --- a/src/utils/commons.js +++ b/src/utils/commons.js @@ -599,7 +599,10 @@ export const logWebsocket = (message, direction) => { var open = indexedDB.open('LogWebsocketData', 2) open.onupgradeneeded = function () { var db = open.result - var store = db.createObjectStore('LogStore', { keyPath: 'id', autoIncrement: true }) + // 数据库是否存在 + if (!db.objectStoreNames.contains('LogStore')) { + var store = db.createObjectStore('LogStore', { keyPath: 'id', autoIncrement: true }) + } } open.onsuccess = function () { var db = open.result