king
2024-05-23 9a11e62adeb8d435b52a361eb62d5b59e1deef2a
src/components/header/index.jsx
@@ -10,6 +10,7 @@
import MKEmitter from '@/utils/events.js'
import Utils from '@/utils/utils.js'
import avatar from '@/assets/img/avatar.jpg'
import wxicon from '@/assets/img/wx-icon.png'
import './index.scss'
const { confirm } = Modal
@@ -24,6 +25,7 @@
    userName: '',
    fullName: '',
    logourl: window.GLOB.mainlogo,
    wxVisible: false,
    loginVisible: false,
    loginLoading: false,
    avatar: Utils.getrealurl(sessionStorage.getItem('avatar')),
@@ -437,6 +439,8 @@
          sessionStorage.setItem('cloudDataM', res.dataM ? 'true' : '')
          sessionStorage.setItem('cloudRole_id', res.role_id || '')
          sessionStorage.setItem('CloudLogo', res.open_logo || '')
          let _url = window.location.href.split('#')[0] + 'cloud'
          if (param.remember) {
            localStorage.setItem(_url, window.btoa(window.encodeURIComponent(JSON.stringify({time: new Date().getTime(), username: param.username, password: param.password}))))
@@ -574,6 +578,8 @@
          } else {
            Api.updateAppVersion()
            Api.delCacheConfig('all')
            localStorage.removeItem(window.location.href.split('#')[0] + 'AuthCode')
            setTimeout(() => {
              notification.success({
                top: 92,
@@ -592,14 +598,6 @@
  about = () => {
    Modal.success({
      title: '系统版本v' + window.GLOB.appVersion
    })
  }
  wxnotice = () => {
    Modal.success({
      className: 'mk-wx-notice',
      title: <QrCode card={{qrWidth: 320, color: '#000000'}} value={window.GLOB.baseurl + 'mob/wxnotice.html?userid=' + sessionStorage.getItem('UserID') + '&loginuid=' + sessionStorage.getItem('LoginUID')}/>,
      okText: '关闭'
    })
  }
@@ -629,7 +627,7 @@
        <Menu.Item key="verup" onClick={this.verup}>
          页面更新
        </Menu.Item>
        {window.GLOB.WXNotice ? <Menu.Item key="wxnotice" onClick={this.wxnotice}>
        {window.GLOB.WXNotice ? <Menu.Item key="wxnotice" onClick={() => this.setState({wxVisible: true})}>
          微信消息
        </Menu.Item> : null}
        {window.GLOB.appVersion ? <Menu.Item key="version" onClick={this.about}>
@@ -802,6 +800,26 @@
        </Modal>
        {/* 修改密码 */}
        <Resetpwd />
        {/* 微信消息 */}
        <Modal
          wrapClassName="mk-wx-sms-modal"
          visible={this.state.wxVisible}
          title="扫码关注  接收消息"
          width={400}
          centered={true}
          onCancel={() => this.setState({wxVisible: false})}
          footer={null}
          destroyOnClose
        >
          <div className="wx-sms-wrap">
            <QrCode card={{qrWidth: 200, color: '#000000'}} value={window.GLOB.baseurl + 'mob/wxnotice.html?userid=' + sessionStorage.getItem('UserID') + '&loginuid=' + sessionStorage.getItem('LoginUID')}/>
            <div className="tip">
              <img src={wxicon} alt=""/>
              <span>微信扫码</span>
              <span>关注公众号</span>
            </div>
          </div>
        </Modal>
      </header>
    )
  }