king
2021-03-01 c45a375e5b4ce0e33c7fc8a1aecdad67d60acc9e
src/index.js
@@ -45,7 +45,6 @@
  )
}
if (sessionStorage.getItem('loginError')) {
  try {
    let res = JSON.parse(sessionStorage.getItem('loginError'))
@@ -58,10 +57,12 @@
sessionStorage.setItem('role_id', sessionStorage.getItem('localRole_id') || '')
sessionStorage.setItem('dataM', sessionStorage.getItem('localDataM') || '')
fetch(`./options.json`)
// 测试系统文件置于admin中
fetch('./options.json')
  .then(response => response.json())
  .catch(() => {
    console.warn('系统配置信息获取失败,请联系管理员!')
    document.getElementById('root').innerHTML = '<div style="text-align: center; font-size: 30px; margin-top: 40vh;">系统配置信息获取失败,请联系管理员!</div>'
  })
  .then(config => {
    if (!config) return
@@ -186,7 +187,7 @@
    }
    if (process.env.NODE_ENV === 'production') { // 用于校验是否存在开发权限
      let _service = window.location.href.replace(/\/index.html(.*)|\/#(.*)/ig, '').replace(new RegExp(document.location.origin + '/?', 'ig'), '')
      let _service = window.location.href.replace(/(\/admin)?\/index.html(.*)|(\/admin)?\/#(.*)/ig, '').replace(new RegExp(document.location.origin + '/?', 'ig'), '')
      GLOB.linkurl = _href
      if (!/index.html/ig.test(GLOB.linkurl)) {
        GLOB.linkurl = GLOB.linkurl + 'index.html'