king
2024-08-28 c10fc10d5fd307a7b334bcde6af5c1175aaa0410
src/index.js
@@ -37,6 +37,8 @@
      }
    }
    config.keepPwd = config.keepPwd || config.keepPassword
    let GLOB = {}
    GLOB.appId = config.appId || ''
    GLOB.lineColor = config.lineColor || ''
@@ -44,7 +46,8 @@
    GLOB.probation = false
    GLOB.watermark = config.watermark + '' !== 'false'
    GLOB.transfer = config.transfer + '' === 'true'
    GLOB.keepKey = config.keepPassword + '' !== 'false'
    GLOB.keepKey = config.keepPwd + '' !== 'false'
    GLOB.vispwd = config.keepPwd + '' !== 'invisible'
    GLOB.WXAppID = config.WXAppID || ''
    GLOB.WXminiAppID = config.WXminiAppID || ''
    GLOB.WXMerchID = config.WXMerchID || ''
@@ -342,36 +345,22 @@
      GLOB.memberLevel = 0
    }
    if (config.devTools === false) {
    if (config.systemRun === 'backend') {
      GLOB.debugger = false
      Object.defineProperty(window, 'backend', {
        writable: false,
        value: true
      })
    }
    if (config.debugger === 'forbid') {
      sessionStorage.removeItem('breakpoint')
      GLOB.debugger = false
      let getVal = () => {
        let _i = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
        let _h = window.outerHeight - _i - 200
        let _w = window.outerWidth - window.innerWidth - 100
        return Math.max(_h, _w)
      }
      if (getVal() > 0) {
        document.body.innerHTML = '<div style="text-align: center; font-size: 30px; padding-top: 40vh;">本系统禁止使用控制台,请关闭控制台重新刷新!</div>'
        return
      } else {
        let timer = null
        window.addEventListener('resize', () => {
          timer && clearTimeout(timer)
          if (getVal() > 0) {
            timer = setTimeout(() => {
              document.body.innerHTML = '<div style="text-align: center; font-size: 30px; padding-top: 40vh;">本系统禁止使用控制台,请关闭控制台重新刷新!</div>'
            }, 100)
          }
        })
      }
    }
    if (GLOB.sysType === 'cloud') {
      Object.defineProperty(GLOB, 'debugger', {
        writable: false,
        value: GLOB.debugger
      })
    } else if (GLOB.sysType === 'cloud') {
      Object.defineProperty(GLOB, 'debugger', {
        writable: false,
        value: GLOB.debugger