| | |
| | | thdMenuList: [], |
| | | debug: sessionStorage.getItem('debug') === 'true' && window.GLOB.memberLevel > 0, |
| | | collapse: sessionStorage.getItem('collapse') === 'true', |
| | | lang: sessionStorage.getItem('lang') || '' |
| | | lang: sessionStorage.getItem('lang') || '', |
| | | dict: window.GLOB.dict |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | componentDidMount () { |
| | | // 获取系统的版本信息,延时查询 |
| | | setTimeout(() => { |
| | | Api.getAppVersion() |
| | | if (!window.GLOB.$error) { |
| | | Api.getAppVersion() |
| | | } |
| | | }, 1000) |
| | | |
| | | // sessionStorage 跨页面共享 |
| | |
| | | setTimeout(() => { |
| | | sessionStorage.clear() |
| | | this.props.history.replace('/login') |
| | | window.location.reload() |
| | | }, 2000) |
| | | }) |
| | | } |
| | | |
| | | logout = () => { |
| | | const { dict } = this.state |
| | | // 退出登录 |
| | | let _this = this |
| | | let that = this |
| | | confirm({ |
| | | title: '您确定要退出吗?', |
| | | title: dict['logout_query'] || '您确定要退出吗?', |
| | | content: '', |
| | | okText: '确定', |
| | | cancelText: '取消', |
| | | okText: dict['ok'] || '确定', |
| | | cancelText: dict['cancel'] || '取消', |
| | | onOk() { |
| | | sessionStorage.clear() |
| | | _this.props.history.replace('/login') |
| | | that.props.history.replace('/login') |
| | | window.location.reload() |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | |
| | | |
| | | if (PageParam.OpenType === 'outpage' && PageParam.linkUrl) { |
| | | fstItem.OpenType = 'newpage' |
| | | fstItem.src = PageParam.linkUrl |
| | | fstItem.src = window.GLOB.systemType === 'production' && PageParam.linkProUrl ? PageParam.linkProUrl : PageParam.linkUrl |
| | | if (/#\/iframe\//.test(fstItem.src)) { |
| | | fstItem.src = fstItem.src.replace(/@loginuid@/ig, sessionStorage.getItem('LoginUID')) |
| | | fstItem.type = 'iframe' |
| | |
| | | |
| | | if (trdItem.type === 'NewPage') { |
| | | trdItem.OpenType = 'newpage' |
| | | trdItem.src = PageParam.url || '' |
| | | trdItem.src = window.GLOB.systemType === 'production' && PageParam.proUrl ? PageParam.proUrl : PageParam.url || '' |
| | | if (/#\/iframe\//.test(trdItem.src)) { |
| | | trdItem.src = trdItem.src.replace(/@loginuid@/ig, sessionStorage.getItem('LoginUID')) |
| | | trdItem.type = 'iframe' |
| | |
| | | |
| | | 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})))) |
| | | localStorage.setItem(window.GLOB.sysSign + 'cloud', window.btoa(window.encodeURIComponent(JSON.stringify({time: new Date().getTime(), username: param.username, password: param.password})))) |
| | | } else { |
| | | localStorage.setItem(_url, window.btoa(window.encodeURIComponent(JSON.stringify({time: new Date().getTime(), username: param.username, password: ''})))) |
| | | localStorage.setItem(window.GLOB.sysSign + 'cloud', window.btoa(window.encodeURIComponent(JSON.stringify({time: new Date().getTime(), username: param.username, password: ''})))) |
| | | } |
| | | |
| | | window.GLOB.mainMenu = null |
| | |
| | | } |
| | | |
| | | verup = () => { |
| | | const { dict } = this.state |
| | | |
| | | confirm({ |
| | | title: '页面更新', |
| | | content: '重新加载应用信息', |
| | | title: dict['page_upd'] || '页面更新', |
| | | content: dict['reload_app'] || '重新加载应用信息', |
| | | okText: dict['ok'] || '确定', |
| | | cancelText: dict['cancel'] || '取消', |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | if (!window.GLOB.IndexDB) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '更新失败,请刷新页面重试!', |
| | | message: dict['exc_fail'] || '更新失败,请刷新页面重试!', |
| | | duration: 2 |
| | | }) |
| | | resolve() |
| | | } else { |
| | | Api.updateAppVersion() |
| | | Api.delCacheConfig('all') |
| | | localStorage.removeItem(window.location.href.split('#')[0] + 'AuthCode') |
| | | |
| | | setTimeout(() => { |
| | | notification.success({ |
| | | top: 92, |
| | | message: '更新成功!', |
| | | message: dict['exc_success'] || '更新成功!', |
| | | duration: 2 |
| | | }) |
| | | resolve() |
| | |
| | | |
| | | about = () => { |
| | | Modal.success({ |
| | | title: '系统版本v' + window.GLOB.appVersion |
| | | title: (window.GLOB.dict['sys_ver'] || '系统版本') + ' v' + window.GLOB.appVersion, |
| | | okText: window.GLOB.dict['got_it'] || '知道了', |
| | | }) |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | render () { |
| | | const { thdMenuList, searchkey, debug, menulist, collapse } = this.state |
| | | const { thdMenuList, searchkey, debug, menulist, collapse, dict } = this.state |
| | | const navBar = window.GLOB.navBar |
| | | |
| | | const menu = ( |
| | | <Menu className="header-dropdown"> |
| | | {debug && <Menu.Item key="switch"> |
| | | 编辑 |
| | | {dict['edit'] || '编辑'} |
| | | <Switch size="small" style={{marginLeft: '7px'}} checked={false} onChange={this.changeEditState} /> |
| | | </Menu.Item>} |
| | | <Menu.Item key="password" onClick={this.changePassword}>修改密码</Menu.Item> |
| | | {this.state.systems.length ? <Menu.SubMenu style={{minWidth: '110px'}} title="切换系统"> |
| | | <Menu.Item key="password" onClick={this.changePassword}>{dict['ch_pwd'] || '修改密码'}</Menu.Item> |
| | | {this.state.systems.length ? <Menu.SubMenu style={{minWidth: '110px'}} title={dict['swt_sys'] || '切换系统'}> |
| | | {this.state.systems.map((system, index) => ( |
| | | <Menu.Item style={{minWidth: '100px', lineHeight: '30px'}} key={'sub' + index} onClick={() => {this.changeSystem(system)}}> {system.AppName} </Menu.Item> |
| | | ))} |
| | | </Menu.SubMenu> : null} |
| | | <Menu.Item key="doc" onClick={this.gotoDoc}>文档中心</Menu.Item> |
| | | <Menu.Item key="doc" onClick={this.gotoDoc}>{dict['doc_center'] || '文档中心'}</Menu.Item> |
| | | <Menu.Item key="verup" onClick={this.verup}> |
| | | 页面更新 |
| | | {dict['page_upd'] || '页面更新'} |
| | | </Menu.Item> |
| | | {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}> |
| | | 关于 |
| | | {dict['about'] || '关于'} |
| | | </Menu.Item> : null} |
| | | <Menu.Item key="logout" onClick={this.logout}>退出</Menu.Item> |
| | | <Menu.Item key="logout" onClick={this.logout}>{dict['logout'] || '退出'}</Menu.Item> |
| | | </Menu> |
| | | ) |
| | | |