| | |
| | | 'use strict'; |
| | | // 'use strict'; |
| | | |
| | | const fs = require('fs'); |
| | | const isWsl = require('is-wsl'); |
| | |
| | | const ModuleNotFoundPlugin = require('react-dev-utils/ModuleNotFoundPlugin'); |
| | | const ForkTsCheckerWebpackPlugin = require('react-dev-utils/ForkTsCheckerWebpackPlugin'); |
| | | const typescriptFormatter = require('react-dev-utils/typescriptFormatter'); |
| | | const eslint = require('eslint'); |
| | | // const eslint = require('eslint'); |
| | | |
| | | const postcssNormalize = require('postcss-normalize'); |
| | | |
| | |
| | | { |
| | | "appId": "201912040924165801464FF1788654BC5AC73", |
| | | "appkey": "20191106103859640976D6E924E464D029CF0", |
| | | "mainSystemApi": "http://sso.mk9h.cn/cloud/webapi/dostars", |
| | | "appId": "20201221213901540C6BC419CE41E47FABA62", |
| | | "appkey": "2020122121373692319E639E61B0E46A6BC2C", |
| | | "mainSystemApi": "http://cloud.positecgroup.com:8080/webapi/dostar", |
| | | "systemType": "", |
| | | "externalDatabase": "false", |
| | | "lineColor": "", |
| | |
| | | } |
| | | |
| | | /** |
| | | * @description 使用dostar接口,跳过验证 |
| | | * @param {Object} param 查询及提交参数 |
| | | */ |
| | | loginAndRedirect (param) { |
| | | let url = '' |
| | | if (process.env.NODE_ENV === 'production') { |
| | | url = document.location.origin + '/Home/LoginAndRedirect' |
| | | } else { |
| | | url = '/Home/LoginAndRedirect' |
| | | } |
| | | |
| | | return axios({ |
| | | url: url, |
| | | data: param |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 使用dostar接口,跳转至dostars |
| | | * @param {Object} param 查询及提交参数 |
| | | */ |
| | |
| | | // 编辑状态下,不可切换菜单 |
| | | return |
| | | } |
| | | |
| | | if (value.PageParam.OpenType === 'menu') { |
| | | this.props.modifyMainMenu(value) |
| | | } else { |
| | | window.open('#/' + value.PageParam.linkUrl + '/') |
| | | } else if (value.PageParam.OpenType === 'outpage') { |
| | | window.open(value.PageParam.linkUrl) |
| | | } |
| | | } |
| | | |
| | |
| | | if (process.env.NODE_ENV === 'production') { |
| | | service = document.location.origin + '/' + window.GLOB.service + 'zh-CN/' |
| | | } else { |
| | | service = window.GLOB.location + window.GLOB.service + 'zh-CN/' |
| | | service = window.GLOB.location + '/' + window.GLOB.service + 'zh-CN/' |
| | | } |
| | | |
| | | class Header extends Component { |
| | |
| | | ) |
| | | } |
| | | |
| | | // bms |
| | | sessionStorage.setItem('UserID', localStorage.getItem('UserID') || '') |
| | | sessionStorage.setItem('LoginUID', localStorage.getItem('LoginUID') || '') |
| | | sessionStorage.setItem('User_Name', localStorage.getItem('User_Name') || '') |
| | | sessionStorage.setItem('Full_Name', localStorage.getItem('Full_Name') || '') |
| | | sessionStorage.setItem('avatar', localStorage.getItem('avatar') || '') |
| | | sessionStorage.setItem('dataM', localStorage.getItem('dataM') || '') |
| | | sessionStorage.setItem('localDataM', localStorage.getItem('localDataM') || '') |
| | | sessionStorage.setItem('debug', localStorage.getItem('debug') || '') |
| | | sessionStorage.setItem('role_id', localStorage.getItem('role_id') || '') |
| | | sessionStorage.setItem('localRole_id', localStorage.getItem('localRole_id') || '') |
| | | |
| | | if (sessionStorage.getItem('loginError')) { |
| | | try { |
| | |
| | | GLOB.service = _service ? _service + '/' : '' |
| | | } else { |
| | | GLOB.linkurl = '' |
| | | GLOB.location = 'http://qingqiumarket.cn/' |
| | | GLOB.service = 'mkwms/' |
| | | GLOB.location = 'http://bms-test.kresstools.cn' |
| | | GLOB.service = 'oc/' |
| | | } |
| | | |
| | | if (GLOB.style && options.styles[GLOB.style]) { |
| | |
| | | const proxy = require('http-proxy-middleware') |
| | | const host = 'http://qingqiumarket.cn' |
| | | const service = 'mkwms/' |
| | | const host = 'http://bms-test.kresstools.cn' |
| | | const service = 'oc/' |
| | | |
| | | module.exports = function(app) { |
| | | app.use(proxy('/webapi', { |
| | |
| | | '^/wxpay': '/' |
| | | } |
| | | })) |
| | | |
| | | app.use(proxy('/Home', { |
| | | target: `${host}/Home`, |
| | | secure: false, |
| | | changeOrigin: true, |
| | | pathRewrite: { |
| | | '^/Home': '/' |
| | | } |
| | | // cookieDomainRewrite: "http://localhost:3000" |
| | | })) |
| | | } |
| | |
| | | sysType: 'bG9j$mkYWw=', // yun ( Y2xv$mkdWQ= ) 、 dandian ( U1$mkNP ) 、 yewu ( bG9j$mkYWw= ) |
| | | caId: 'MjAyMDAxMTYxMjMzMzU1MDd$mkGQzkyMzI1Rjk4MDY0QUNGQjQ2Mg==', |
| | | cakey: 'MjAyMDAxMTYxMjQwMDQ2NDM$mk2N0QzODE2MjExNUI0MTc4OTVDMQ==', |
| | | cdomain: 'aHR0cDovL2Nsb3V$mkkLm1rOWguY24=', // window.btoa('') 域名 不带 /; baoshide ( aHR0cDovL2Nsb3VkLnBv$mkc2l0ZWNncm91cC5jb206ODA4MA== ) |
| | | cdomain: 'aHR0cDovL2Nsb3VkLnBv$mkc2l0ZWNncm91cC5jb206ODA4MA==', // window.btoa('') 域名 不带 /; baoshide ( aHR0cDovL2Nsb3VkLnBv$mkc2l0ZWNncm91cC5jb206ODA4MA== ) |
| | | styles: { |
| | | white: 'mk-white' |
| | | } |
| | |
| | | if (process.env.NODE_ENV === 'production') { |
| | | service = document.location.origin + '/' + window.GLOB.service |
| | | } else { |
| | | service = window.GLOB.location + window.GLOB.service |
| | | service = window.GLOB.location + '/' + window.GLOB.service |
| | | } |
| | | |
| | | class FileUpload extends Component { |
| | |
| | | if (process.env.NODE_ENV === 'production') { |
| | | baseurl = document.location.origin + '/' + window.GLOB.service |
| | | } else { |
| | | baseurl = window.GLOB.location + window.GLOB.service |
| | | baseurl = window.GLOB.location + '/' + window.GLOB.service |
| | | } |
| | | |
| | | let realurl = url.match(/^http/) || url.match(/^\/\//) ? url : baseurl + url |
| | |
| | | // 登录提交 |
| | | let res = await Api.getusermsg(param.username, param.password) |
| | | if (res.status) { |
| | | 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 || '') |
| | | localStorage.setItem('UserID', res.UserID) |
| | | localStorage.setItem('LoginUID', res.LoginUID) |
| | | localStorage.setItem('User_Name', res.UserName) |
| | | localStorage.setItem('Full_Name', res.FullName) |
| | | localStorage.setItem('avatar', res.icon || '') |
| | | localStorage.setItem('dataM', res.dataM ? 'true' : '') |
| | | localStorage.setItem('localDataM', res.dataM ? 'true' : '') |
| | | localStorage.setItem('debug', res.debug || '') |
| | | localStorage.setItem('role_id', res.role_id || '') |
| | | localStorage.setItem('localRole_id', res.role_id || '') |
| | | |
| | | localStorage.setItem('lang', param.lang || 'zh-CN') |
| | | localStorage.setItem('lang', 'zh-CN') |
| | | |
| | | let _url = window.location.href.split('#')[0] |
| | | |
| | |
| | | localStorage.removeItem(_url) |
| | | } |
| | | |
| | | // if (this.props.location.state && this.props.location.state.from.pathname) { |
| | | // // 查看是否为其他页面跳转,路径存在时,跳回原页面 |
| | | // this.props.history.replace(this.props.location.state.from.pathname) |
| | | // } |
| | | |
| | | let _history = sessionStorage.getItem('history') |
| | | if (_history) { |
| | | sessionStorage.removeItem('history') |
| | | // 查看是否为其他页面跳转,路径存在时,跳回原页面 |
| | | this.props.history.replace(_history) |
| | | } else { |
| | | this.props.history.replace('/main') |
| | | let _param = { |
| | | UserName: param.username, |
| | | Password: param.password, |
| | | BasePath: '/' |
| | | } |
| | | |
| | | localStorage.setItem('bmsSystem', param.system) |
| | | |
| | | if (param.system !== 'new') { |
| | | Api.loginAndRedirect(_param).then(result => { |
| | | if (result.IsError) { |
| | | this.setState({ |
| | | isDisabled: false |
| | | }) |
| | | message.warning('登录失败,用户名或密码错误!') |
| | | } else { |
| | | if (process.env.NODE_ENV === 'production') { |
| | | window.location.replace(document.location.origin + '/Home/Index') |
| | | } else { |
| | | window.location.replace(window.GLOB.location + '/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('应用尚未创建,请向云端同步应用!') |
| | | |
| | |
| | | } |
| | | |
| | | render () { |
| | | const { lineColor, bgImage, loginlogo, copyRight, webSite, ICP, loginWays, touristLogin } = this.state |
| | | const { lineColor, loginlogo, bgImage, copyRight, webSite, ICP, loginWays, touristLogin } = this.state |
| | | |
| | | return ( |
| | | <div className="login-container" style={bgImage ? {backgroundImage: 'url(' + bgImage + ')'} : {}}> |
| | | <div className="login-container"> |
| | | <div className="logo" style={lineColor ? {borderColor: lineColor} : {}}> |
| | | {loginlogo ? <img src={loginlogo} alt=""/> : null} |
| | | {this.state.platName ? <p className="plat-name">{this.state.platName}</p> : null} |
| | | </div> |
| | | <div className="login-middle" style={lineColor ? {borderColor: lineColor} : {}}> |
| | | <div className="login-middle" style={bgImage ? {backgroundImage: 'url(' + bgImage + ')'} : null}> |
| | | {loginWays ? <LoginForm |
| | | platName={this.state.platName} |
| | | dict={this.state.dict} |
| | |
| | | .login-container { |
| | | height: 100vh; |
| | | min-height: 600px; |
| | | background-color: #000000; |
| | | background-color: #ffffff; |
| | | background-size: cover; |
| | | background-repeat: no-repeat; |
| | | background-position: center center; |
| | | .logo { |
| | | position: relative; |
| | | height: 100px; |
| | | padding-top: 30px; |
| | | line-height: 80px; |
| | | border-bottom: 2px solid #1890ff; |
| | | height: 70px; |
| | | padding-top: 10px; |
| | | width: 990px; |
| | | margin: 0 auto; |
| | | img { |
| | | max-height: 100%; |
| | | } |
| | |
| | | .login-middle { |
| | | position: relative; |
| | | height: calc(100vh - 194px); |
| | | min-height: 420px; |
| | | background-size: cover; |
| | | min-height: 475px; |
| | | background-color: #427CAA; |
| | | background-image: url('http://bms-test.kresstools.cn/Content/images/login2/bg_mid.png'); |
| | | background-size: contain; |
| | | background-repeat: no-repeat; |
| | | background-position: center center; |
| | | border-bottom: 2px solid #1890ff; |
| | | |
| | | .login-form { |
| | | float: right; |
| | |
| | | |
| | | .form-item-wrap { |
| | | padding: 0.6vw 1.6vw 1.6vw; |
| | | } |
| | | .title { |
| | | color: #427CAA; |
| | | font-size: 22px; |
| | | font-weight: bold; |
| | | margin: 15px 1.6vw 5px; |
| | | } |
| | | |
| | | h4 { |
| | |
| | | } |
| | | .login-bottom { |
| | | text-align: center; |
| | | color: #ffffff; |
| | | color: #666; |
| | | padding-top: 20px; |
| | | font: 12px/150% Arial,Verdana,"\5b8b\4f53"; |
| | | p span.split { |
| | | margin-right: 15px; |
| | | } |
| | | a { |
| | | display: inline-block; |
| | | margin-bottom: 5px; |
| | | color: #ffffff; |
| | | color: #666; |
| | | font: 12px/150% Arial,Verdana,"\5b8b\4f53"; |
| | | } |
| | | } |
| | | .ant-btn-primary[disabled] { |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Form, Icon, Input, Button, Checkbox, Select, Modal, Tabs, message } from 'antd' |
| | | import { Form, Icon, Input, Button, Checkbox, Select, Modal, message } from 'antd' |
| | | import md5 from 'md5' |
| | | import moment from 'moment' |
| | | |
| | |
| | | import './index.scss' |
| | | |
| | | const { warning } = Modal |
| | | const { TabPane } = Tabs |
| | | let LoginVerCodeTimer = null |
| | | |
| | | class LoginTabForm extends Component { |
| | |
| | | |
| | | return ( |
| | | <Form className={`login-form login-form-${loginWays.length}`} id="login-form" onSubmit={this.handleSubmit}> |
| | | <Tabs type="card" activeKey={activeKey} onChange={this.onChangeTab}> |
| | | {loginWays.map(item => (<TabPane tab={item.label} key={item.type}></TabPane>))} |
| | | </Tabs> |
| | | <p className="title">{this.props.platName}</p> |
| | | <div className="form-item-wrap"> |
| | | {activeKey === 'uname_pwd' ? <Form.Item> |
| | | {getFieldDecorator('username', { |
| | |
| | | initialValue: remember, |
| | | })(<Checkbox onChange={this.rememberChange}>{this.props.dict['login.remember']}</Checkbox>)} |
| | | </Form.Item> : null} |
| | | {this.props.langList && this.props.langList.length > 0 ? <Form.Item className="minline right"> |
| | | {getFieldDecorator('lang', { |
| | | initialValue: this.props.lang, |
| | | <Form.Item className="minline right"> |
| | | {getFieldDecorator('system', { |
| | | initialValue: localStorage.getItem('bmsSystem') === 'new' ? 'new' : 'old', |
| | | })( |
| | | <Select |
| | | onChange={(value) => {this.changelang(value)}} |
| | | getPopupContainer={() => document.getElementById('login-form')} |
| | | > |
| | | {this.props.langList.map((item, index) => { |
| | | return <Select.Option key={index} value={item.Lang}>{item.LangName}</Select.Option> |
| | | })} |
| | | <Select getPopupContainer={() => document.getElementById('login-form')}> |
| | | <Select.Option key="old" value="old">原系统</Select.Option> |
| | | <Select.Option key="new" value="new">新系统</Select.Option> |
| | | </Select> |
| | | )} |
| | | </Form.Item> : null} |
| | | </Form.Item> |
| | | {['uname_pwd', 'sms_vcode'].includes(activeKey) ? <Form.Item className="btn-login"> |
| | | <Button type="primary" htmlType="submit" className="login-form-button" disabled={this.props.isDisabled} loading={this.props.isDisabled}> |
| | | {this.props.dict['login.submit']} |