king
2023-03-15 3875da845b8fae679bd784d1246101a5fb1b61b5
src/utils/utils.js
@@ -2253,24 +2253,24 @@
 */
export function setGLOBFuncs () {
  window.GLOB.funcs = []
  if (!window.GLOB.WebSql && !window.GLOB.IndexDB) {
  if (!window.GLOB.IndexDB) {
    return
  }
  if (window.GLOB.WebSql) {
    window.GLOB.WebSql.transaction(tx => {
      tx.executeSql("SELECT * FROM FUNCS", [], (tx, results) => {
        let rows = results.rows
        if (!rows || rows.length === 0) return
        for (let i = 0; i < rows.length; i++) {
          window.GLOB.funcs.push({
            func_code: rows[i].func_code,
            key_sql: window.decodeURIComponent(window.atob(rows[i].key_sql))
          })
        }
      })
    })
  } else {
  // if (window.GLOB.WebSql) {
  //   window.GLOB.WebSql.transaction(tx => {
  //     tx.executeSql("SELECT * FROM FUNCS", [], (tx, results) => {
  //       let rows = results.rows
  //       if (!rows || rows.length === 0) return
  //       for (let i = 0; i < rows.length; i++) {
  //         window.GLOB.funcs.push({
  //           func_code: rows[i].func_code,
  //           key_sql: window.decodeURIComponent(window.atob(rows[i].key_sql))
  //         })
  //       }
  //     })
  //   })
  // } else {
    let objectStore = window.GLOB.IndexDB.transaction('funcs').objectStore('funcs')
    objectStore.openCursor().onsuccess = (event) => {
@@ -2284,7 +2284,7 @@
        cursor.continue()
      }
    }
  }
  // }
}
/**