| | |
| | | BasePath: '/' |
| | | } |
| | | |
| | | localStorage.setItem('bmsSystem', param.system) |
| | | |
| | | Api.loginAndRedirect(_param).then(result => { |
| | | if (result.IsError) { |
| | | this.setState({ |
| | | isDisabled: false |
| | | }) |
| | | message.warning('登录失败,用户名或密码错误!') |
| | | } else { |
| | | if (param.system !== 'new') { |
| | | if (process.env.NODE_ENV === 'production') { |
| | | window.location.replace(document.location.origin + '/Home/Index') |
| | | } else { |
| | | window.location.replace(window.GLOB.location + '/Home/Index') |
| | | } |
| | | if (process.env.NODE_ENV === 'production') { |
| | | Api.loginAndRedirect(_param).then(result => { |
| | | if (result.IsError) { |
| | | this.setState({ |
| | | isDisabled: false |
| | | }) |
| | | message.warning('登录失败,用户名或密码错误!') |
| | | } else { |
| | | sessionStorage.setItem('UserID', res.UserID) |
| | | sessionStorage.setItem('LoginUID', res.LoginUID) |
| | | sessionStorage.setItem('User_Name', res.UserName) |
| | | sessionStorage.setItem('Full_Name', res.FullName) |
| | | sessionStorage.setItem('avatar', res.icon || '') |
| | | sessionStorage.setItem('dataM', res.dataM ? 'true' : '') |
| | | sessionStorage.setItem('localDataM', res.dataM ? 'true' : '') |
| | | sessionStorage.setItem('debug', res.debug || '') |
| | | sessionStorage.setItem('role_id', res.role_id || '') |
| | | sessionStorage.setItem('localRole_id', res.role_id || '') |
| | | |
| | | let _history = sessionStorage.getItem('history') |
| | | if (_history) { |
| | | sessionStorage.removeItem('history') |
| | | // 查看是否为其他页面跳转,路径存在时,跳回原页面 |
| | | this.props.history.replace(_history) |
| | | } else { |
| | | this.props.history.replace('/main') |
| | | } |
| | | window.location.replace(document.location.origin + '/Home/Index') |
| | | } |
| | | }) |
| | | } else { |
| | | sessionStorage.setItem('UserID', res.UserID) |
| | | sessionStorage.setItem('LoginUID', res.LoginUID) |
| | | sessionStorage.setItem('User_Name', res.UserName) |
| | | sessionStorage.setItem('Full_Name', res.FullName) |
| | | sessionStorage.setItem('avatar', res.icon || '') |
| | | sessionStorage.setItem('dataM', res.dataM ? 'true' : '') |
| | | sessionStorage.setItem('localDataM', res.dataM ? 'true' : '') |
| | | sessionStorage.setItem('debug', res.debug || '') |
| | | sessionStorage.setItem('role_id', res.role_id || '') |
| | | sessionStorage.setItem('localRole_id', res.role_id || '') |
| | | |
| | | let _history = sessionStorage.getItem('history') |
| | | if (_history) { |
| | | sessionStorage.removeItem('history') |
| | | // 查看是否为其他页面跳转,路径存在时,跳回原页面 |
| | | this.props.history.replace(_history) |
| | | } else { |
| | | this.props.history.replace('/main') |
| | | } |
| | | }) |
| | | } |
| | | } else if (res.ErrCode === 'Need_Get_Appkey' && options.sysType === 'SSO') { |
| | | message.warning('应用尚未创建,请向云端同步应用!') |
| | | |