king
2021-04-13 e0aff8f4c0e9c8f16d1ba07863cf600638067514
src/pc/components/login/normal-login/index.jsx
@@ -9,6 +9,7 @@
import MKEmitter from '@/utils/events.js'
import zhCN from '@/locales/zh-CN/model.js'
import enUS from '@/locales/en-US/model.js'
import { resetStyle } from '@/utils/utils-custom.js'
import './index.scss'
const LoginForm = asyncComponent(() => import('./loginform'))
@@ -31,6 +32,7 @@
    const { card } = this.props
    if (card.isNew) {
      let ismob = sessionStorage.getItem('appType') === 'mob'
      let _card = {
        uuid: card.uuid,
        type: card.type,
@@ -41,12 +43,20 @@
        width: card.width || 24,
        name: card.name,
        subtype: card.subtype,
        wrap: { name: card.name, width: card.width || 24, loginWays: ['uname_pwd', 'sms_vcode'] },
        style: { background: '#ffffff', width: '330px', borderRadius: '4px', marginLeft: '55vw' },
        wrap: { name: card.name, width: card.width || 24, loginWays: ['uname_pwd'] },
        style: { background: '#ffffff', width: '330px', borderRadius: '4px', marginLeft: '55vw'},
        loginWays: [
          {type: 'uname_pwd', label: '账号密码', remember: 'true', labelStyle: {}, submitStyle: {}, submitLabel: '登录'},
          {type: 'sms_vcode', label: '短信验证码', labelStyle: {}, submitStyle: {}, submitLabel: '登录'}
        ]
      }
      if (ismob) {
        delete _card.style.width
        delete _card.style.borderRadius
        delete _card.style.marginLeft
        _card.style.paddingTop = '20px'
      }
      if (card.config) {
@@ -128,9 +138,10 @@
  render() {
    const { card, dict } = this.state
    let style = resetStyle(card.style)
    return (
      <div className="login-edit-box" style={{...card.style}} onClick={this.clickComponent} id={card.uuid}>
      <div className="login-edit-box" style={style} onClick={this.clickComponent} id={card.uuid}>
        <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
          <div className="mk-popover-control">
            <WrapComponent config={card} updateConfig={this.updateComponent} />
@@ -140,7 +151,7 @@
        } trigger="hover">
          <Icon type="tool" />
        </Popover>
        <LoginForm loginWays={card.loginWays} wrap={card.wrap} dict={dict} />
        <LoginForm loginWays={card.loginWays} wrap={card.wrap} menuId={card.uuid} dict={dict} />
      </div>
    )
  }