| | |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | | import MKEmitter from '@/utils/events.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 './index.scss' |
| | | |
| | | const LoginForm = asyncLoadComponent(() => import('./loginform')) |
| | | const Resetpwd = asyncLoadComponent(() => import('@/components/header/resetpwd')) |
| | | const Resetpwd = asyncLoadComponent(() => import('@/components/resetPassword')) |
| | | const LoginCloudForm = asyncComponent(() => import('./logincloudform')) |
| | | const LoginCodeForm = asyncComponent(() => import('./logincodeform')) |
| | | const iszhCN = sessionStorage.getItem('lang') !== 'en-US' |
| | |
| | | loginWays: null, |
| | | touristLogin: false, |
| | | syncing: false, |
| | | visible: false, |
| | | resetLoading: false |
| | | } |
| | | |
| | | changelang (item) { |
| | |
| | | if (visible) { |
| | | message.warning(tip) |
| | | this.setState({ |
| | | isDisabled: false, |
| | | visible: true |
| | | isDisabled: false |
| | | }) |
| | | |
| | | MKEmitter.emit('resetpassword', () => { |
| | | const input = document.getElementById('password') |
| | | if (input) { |
| | | input.select() |
| | | } |
| | | }) |
| | | return |
| | | } |
| | |
| | | login_ways.push({ |
| | | type: item.way_no, |
| | | smsId: item.sms_id |
| | | }) |
| | | }) |
| | | |
| | | if (item.way_no === 'sms_vcode' && item.sms_id) { |
| | | sessionStorage.setItem('mk_sms_id', item.sms_id) |
| | | } |
| | | }) |
| | | } else { |
| | | login_ways.push({ |
| | |
| | | }, () => {}) |
| | | } |
| | | |
| | | resetPwdSubmit = () => { |
| | | this.formRef.handleConfirm().then(res => { |
| | | this.setState({ |
| | | resetLoading: true |
| | | }) |
| | | |
| | | let _param = { |
| | | func: 's_PwdUpt', |
| | | LText: `select '${res.originpwd}','${res.password}'` |
| | | } |
| | | |
| | | _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') // 时间戳 |
| | | _param.LText = Utils.formatOptions(_param.LText) // 关键字符替换,base64加密 |
| | | _param.secretkey = Utils.encrypt(_param.LText, _param.timestamp) // md5密钥 |
| | | |
| | | Api.getSystemConfig(_param).then(result => { |
| | | this.setState({ |
| | | visible: !result.status, |
| | | resetLoading: false |
| | | }) |
| | | |
| | | if (result.status) { |
| | | notification.success({ |
| | | top: 92, |
| | | message: '修改成功,请重新登录。', |
| | | duration: 2 |
| | | }) |
| | | const input = document.getElementById('password') |
| | | if (input) { |
| | | input.select() |
| | | } |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | }, () => {}) |
| | | } |
| | | |
| | | /** |
| | | * @description 组件销毁,清除state更新 |
| | | */ |
| | |
| | | <LoginCloudForm handleSubmit={() => this.syncSubmit()} wrappedComponentRef={(inst) => this.logincloudRef = inst}/> |
| | | </Modal> |
| | | {/* 修改密码 */} |
| | | <Modal |
| | | title="修改密码" |
| | | okText={this.state.dict['login.ok']} |
| | | cancelText={this.state.dict['login.cancel']} |
| | | visible={this.state.visible} |
| | | onOk={this.resetPwdSubmit} |
| | | maskClosable={false} |
| | | confirmLoading={this.state.resetLoading} |
| | | onCancel={() => this.setState({visible: false, resetLoading: false})} |
| | | destroyOnClose |
| | | > |
| | | <Resetpwd wrappedComponentRef={(inst) => this.formRef = inst} resetPwdSubmit={this.resetPwdSubmit}/> |
| | | </Modal> |
| | | <Resetpwd /> |
| | | {/* 二次验证 */} |
| | | <Modal |
| | | title="二次验证" |