| | |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | | import options from '@/store/options.js' |
| | | import options, { styles } from '@/store/options.js' |
| | | import zhCN from '@/locales/zh-CN/login.js' |
| | | import enUS from '@/locales/en-US/login.js' |
| | | import asyncLoadComponent from '@/utils/asyncLoadComponent' |
| | |
| | | |
| | | const LoginForm = asyncLoadComponent(() => import('./loginform')) |
| | | const LoginCloudForm = asyncLoadComponent(() => import('./logincloudform')) |
| | | const iszhCN = localStorage.getItem('lang') !== 'en-US' |
| | | const iszhCN = sessionStorage.getItem('lang') !== 'en-US' |
| | | |
| | | const _href = window.location.href.split('#')[0] |
| | | if (localStorage.getItem(_href + 'paramsmain')) { |
| | |
| | | syncApp: false, |
| | | loginWays: null, |
| | | touristLogin: false, |
| | | syncing: false |
| | | syncing: false, |
| | | ipAddress: '', |
| | | city: '' |
| | | } |
| | | |
| | | UNSAFE_componentWillMount() { |
| | |
| | | * @param {Object} param 用户名密码等信息 |
| | | */ |
| | | async loginsubmit (param) { |
| | | const { ipAddress, city } = this.state |
| | | if (options.sysType === 'local' && !window.GLOB.mainSystemApi) { // 业务系统必须设置单点地址 |
| | | Modal.warning({ |
| | | title: '未设置单点服务器地址,请联系管理员!' |
| | |
| | | } |
| | | |
| | | // 登录提交 |
| | | let res = await Api.getusermsg(param.username, param.password) |
| | | let res = await Api.getusermsg(param.username, param.password, false, ipAddress, city) |
| | | if (res.status) { |
| | | localStorage.setItem('UserID', res.UserID) |
| | | localStorage.setItem('LoginUID', res.LoginUID) |
| | |
| | | } |
| | | |
| | | async phoneloginsubmit (param) { |
| | | const { ipAddress, city } = this.state |
| | | if (options.sysType === 'local' && !window.GLOB.mainSystemApi) { // 业务系统必须设置单点地址 |
| | | Modal.warning({ |
| | | title: '未设置单点服务器地址,请联系管理员!' |
| | |
| | | } |
| | | |
| | | // 登录提交 |
| | | let res = await Api.getphoneusermsg(param.phone, param.vercode) |
| | | let res = await Api.getphoneusermsg(param.phone, param.vercode, false, ipAddress, city) |
| | | if (res.status) { |
| | | sessionStorage.setItem('UserID', res.UserID) |
| | | sessionStorage.setItem('LoginUID', res.LoginUID) |
| | |
| | | sessionStorage.setItem('role_id', res.role_id || '') |
| | | sessionStorage.setItem('localRole_id', res.role_id || '') |
| | | |
| | | localStorage.setItem('lang', param.lang || 'zh-CN') |
| | | let _url = window.location.href.split('#')[0] |
| | | |
| | | localStorage.setItem(_url + 'lang', param.lang || 'zh-CN') |
| | | sessionStorage.setItem('lang', param.lang || 'zh-CN') |
| | | |
| | | sessionStorage.removeItem('visitorUserID') |
| | | sessionStorage.removeItem('visitorLoginUID') |
| | | |
| | | let _history = sessionStorage.getItem('history') |
| | | if (_history) { |
| | |
| | | } |
| | | |
| | | componentDidMount () { |
| | | // 获取ip及城市信息 |
| | | Api.directRequest('http://epc.mk9h.cn/webapi/iploc', 'get', null, 'true').then(res => { |
| | | if (!res || !res.location) return |
| | | sessionStorage.setItem('city', res.location) |
| | | this.setState({ |
| | | ipAddress: res.ip || '', |
| | | city: res.location |
| | | }) |
| | | }) |
| | | const timeStamp = new Date().getTime() |
| | | const _authUrl = window.location.href.split('#')[0] + 'AuthCode' |
| | | |
| | |
| | | let _id = window.atob('YmgwYmFwYWJ0ZDQ1ZXBz$mkZ3JhNzlzZWdiY2g2YzFpYms='.replace(/\$mk/ig, '')) |
| | | |
| | | let param = { |
| | | rduri: _rduri, |
| | | func: _func, |
| | | AppID: _appId, |
| | | TimeStamp: timeStamp, |
| | | appkey: window.GLOB.appkey, |
| | | userid: _id, |
| | | LoginUID: _id |
| | | LoginUID: _id, |
| | | nonc: Utils.getuuid() |
| | | } |
| | | |
| | | Api.dostarToDostars(param).then(res => { |
| | | let keys = Object.keys(param).sort() |
| | | let values = '' |
| | | keys.forEach(key => { |
| | | values += key + param[key] |
| | | }) |
| | | param.sign = md5(values) |
| | | param.t = new Date().getTime() |
| | | |
| | | Api.directRequest(_rduri + '/sEmpowerCloud_Get_LinkUrl', 'post', param, 'true').then(res => { |
| | | if (res.status) { |
| | | if (res.EPC === str) { |
| | | let box = [] |
| | |
| | | |
| | | Api.getTouristMsg().then(result => { |
| | | if (result.status) { |
| | | if (result.UserID && !sessionStorage.getItem('UserID')) { |
| | | sessionStorage.setItem('UserID', result.UserID) |
| | | } |
| | | if (result.LoginUID && !sessionStorage.getItem('LoginUID')) { |
| | | sessionStorage.setItem('LoginUID', result.LoginUID) |
| | | } |
| | | sessionStorage.setItem('visitorUserID', result.UserID || '') |
| | | sessionStorage.setItem('visitorLoginUID', result.LoginUID || '') |
| | | |
| | | if (result.UserID && result.LoginUID) { |
| | | this.setState({touristLogin: true}) |
| | |
| | | LText: `select '${window.GLOB.appkey}'`, |
| | | } |
| | | |
| | | _param.userid = result.UserID |
| | | _param.LoginUID = result.LoginUID |
| | | _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | _param.secretkey = Utils.encrypt(_param.LText, _param.timestamp) |
| | | |
| | | Api.getSystemConfig(_param).then(res => { |
| | | if (res.status) { |
| | | // positecgroup |
| | | res.Banner = res.Banner ? res.Banner.replace(/:8080/ig, '').replace(/http:/ig, 'https:') : '' |
| | | res.doclogo = res.doclogo ? res.doclogo.replace(/:8080/ig, '').replace(/http:/ig, 'https:') : '' |
| | | res.indexlogo = res.indexlogo ? res.indexlogo.replace(/:8080/ig, '').replace(/http:/ig, 'https:') : '' |
| | | res.loginlogo = res.loginlogo ? res.loginlogo.replace(/:8080/ig, '').replace(/http:/ig, 'https:') : '' |
| | | |
| | | let _url = window.location.href.split('#')[0] + 'system' |
| | | let systemMsg = { |
| | | favicon: res.titlelogo || '', |
| | |
| | | doclogo: res.doclogo || '', |
| | | style: res.CSS || '', |
| | | showline: res.split_line_show || 'true', |
| | | webSite: res.WebSite || '' |
| | | webSite: res.WebSite || '', |
| | | navBar: res.menu_type |
| | | } |
| | | |
| | | sessionStorage.setItem('home_background', res.index_background_color) |
| | |
| | | |
| | | window.GLOB.mainlogo = systemMsg.mainlogo |
| | | window.GLOB.style = systemMsg.style |
| | | window.GLOB.navBar = systemMsg.navBar |
| | | |
| | | if (window.GLOB.style && options.styles[window.GLOB.style]) { |
| | | document.body.className = options.styles[window.GLOB.style] + ' ' + (res.split_line_show === 'false' ? 'hidden-split-line' : '') |
| | | if (window.GLOB.style && styles[window.GLOB.style]) { |
| | | document.body.className = styles[window.GLOB.style] + ' ' + (res.split_line_show === 'false' ? 'hidden-split-line' : '') |
| | | } |
| | | |
| | | if (res.titlelogo && window.GLOB.favicon !== res.titlelogo) { |
| | |
| | | } |
| | | |
| | | if (res.users_upt === 'true' && window.GLOB.systemType === 'production') { |
| | | Api.getLocalConfig ({func: 's_Get_local_u_deleted', users_upt_date: res.users_upt_date}).then(localres => { |
| | | Api.getLocalConfig ({ |
| | | func: 's_Get_local_u_deleted', |
| | | users_upt_date: res.users_upt_date, |
| | | userid: result.UserID, |
| | | LoginUID: result.LoginUID |
| | | }).then(localres => { |
| | | if (!localres.status) return |
| | | Api.getSystemConfig({func: 's_get_sso_u_create', user_ids: localres.user_ids, user_ids_local: localres.user_ids_local, users_upt_date: localres.users_upt_date}).then(ssores => { |
| | | Api.getSystemConfig({ |
| | | func: 's_get_sso_u_create', |
| | | user_ids: localres.user_ids, |
| | | user_ids_local: localres.user_ids_local, |
| | | users_upt_date: localres.users_upt_date, |
| | | userid: result.UserID, |
| | | LoginUID: result.LoginUID |
| | | }).then(ssores => { |
| | | if (!ssores.status) return |
| | | Api.getLocalConfig ({func: 's_get_local_u_create', user_ids_local: ssores.user_ids_local}) |
| | | Api.getLocalConfig ({ |
| | | func: 's_get_local_u_create', |
| | | user_ids_local: ssores.user_ids_local, |
| | | userid: result.UserID, |
| | | LoginUID: result.LoginUID |
| | | }) |
| | | }) |
| | | }) |
| | | } |
| | |
| | | </div> |
| | | <div className="login-bottom"> |
| | | {webSite && copyRight ? |
| | | <a target="blank" href={webSite} dangerouslySetInnerHTML={{ __html: copyRight.replace(/\s/ig, ' ') }}></a> : |
| | | <a target="_blank" rel="noopener noreferrer" href={webSite} dangerouslySetInnerHTML={{ __html: copyRight.replace(/\s/ig, ' ') }}></a> : |
| | | <p dangerouslySetInnerHTML={{ __html: copyRight ? copyRight.replace(/\s/ig, ' ') : '' }}></p> |
| | | } |
| | | {ICP ? <p dangerouslySetInnerHTML={{ __html: ICP.replace(/\s/ig, ' ') }}></p> : null} |
| | |
| | | cancelText={this.state.dict['login.auth.cancel']} |
| | | visible={this.state.syncApp} |
| | | onOk={this.syncSubmit} |
| | | maskClosable={false} |
| | | className="sync-cloud-application" |
| | | width={'430px'} |
| | | confirmLoading={this.state.syncing} |