king
2023-08-15 a94b0a4d15b26ecf8fe99f0a1c3e60d60b97766d
src/components/header/index.jsx
@@ -15,7 +15,6 @@
import asyncComponent from '@/utils/asyncComponent'
import Api from '@/api'
import MKEmitter from '@/utils/events.js'
import options from '@/store/options.js'
import Utils from '@/utils/utils.js'
import avatar from '@/assets/img/avatar.jpg'
import './index.scss'
@@ -91,7 +90,7 @@
  getRolesMenu () {
    // 获取主菜单参数
    let _param = {func: 's_get_pc_menus', systemType: options.sysType}
    let _param = {func: 's_get_pc_menus', systemType: window.GLOB.sysType}
    _param.pro_sys = window.GLOB.systemType === 'production' ? 'Y' : ''
    
    Api.getSystemConfig(_param).then(result => {
@@ -107,10 +106,10 @@
      const { menulist, thdMenuList } = this.getMenulist(result)
      let systems = []
      if ((options.sysType === 'local' || options.sysType === 'SSO') && result.sys_list) {
      if ((window.GLOB.sysType === 'local' || window.GLOB.sysType === 'SSO') && result.sys_list) {
        systems = result.sys_list
        if (options.sysType === 'local' && window.GLOB.systemType !== 'production' && systems.length > 10) {
        if (window.GLOB.sysType === 'local' && window.GLOB.systemType !== 'production' && systems.length > 10) {
          systems.length = 10
        }
      }
@@ -314,8 +313,6 @@
        loginVisible: true
      })
    } else {
      sessionStorage.setItem('isEditState', 'true')
      this.props.modifyMainMenu(null)
      this.props.history.replace('/design')
@@ -355,8 +352,6 @@
          sessionStorage.setItem('CloudAvatar', res.icon)
          sessionStorage.setItem('cloudDataM', res.dataM ? 'true' : '')
          sessionStorage.setItem('cloudRole_id', res.role_id || '')
          sessionStorage.setItem('isEditState', 'true')
          let _url = window.location.href.split('#')[0] + 'cloud'
          if (param.remember) {
@@ -475,8 +470,12 @@
      } else if (e.key === 'getSysPermission' && e.newValue === window.GLOB.appkey) {
        localStorage.setItem('sysPermissions', JSON.stringify({mkThdMenus: window.GLOB.mkThdMenus, mkActions: window.GLOB.mkActions}))
      } else if (e.key === 'menuUpdate') {
        let menuId = e.newValue.split(',')[1]
        if (menuId) {
        let vals = e.newValue.split(',')
        let menuId = vals[1]
        let position = vals[2] || ''
        if (position === 'menu') {
          MKEmitter.emit('reloadMenuView', menuId)
        } else if (menuId) {
          Api.getAppVersion(menuId).then(() => {
            MKEmitter.emit('reloadMenuView', menuId)
          })
@@ -499,11 +498,11 @@
  }
  gotoDoc = () => {
    if (options.sysType === 'local' && window.GLOB.mainSystemApi) {
    if (window.GLOB.sysType === 'local' && window.GLOB.mainSystemApi) {
      let ssodomain = window.GLOB.mainSystemApi.replace('/webapi/dostars', '')
      let url = `${ssodomain}/doc/index.html#?appkey=${window.GLOB.appkey}&LoginUID=${sessionStorage.getItem('LoginUID')}`
      window.open(url)
    } else if (options.sysType === 'SSO' || options.sysType === 'cloud') {
    } else if (window.GLOB.sysType === 'SSO' || window.GLOB.sysType === 'cloud') {
      window.open(`${window.location.href.replace(/\/admin(.*)|\/index.html(.*)|\/#(.*)/ig, '')}/doc/index.html#?appkey=${window.GLOB.appkey}&LoginUID=${sessionStorage.getItem('LoginUID')}`)
    }
  }