king
2024-08-07 fcb123b694b9766016a562d7946d57155330fffa
2024-08-07
10个文件已修改
115 ■■■■ 已修改文件
public/README.txt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/options.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/header/loginform.jsx 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/index.js 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/index.jsx 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/verifycard/index.jsx 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pc/components/login/normal-login/loginform.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pc/components/login/normal-login/options.jsx 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/login/loginform.jsx 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/README.txt
@@ -20,7 +20,7 @@
storeKey          -- 电子档案本地授权码,使用本地许可密钥时有效
probation         -- 试用期(YYYY-MM-DD),在正式系统中,试用期内调用系统接口的脚本会记录下来
transfer          -- 是否使用转接口,使用转接口时请设置为 true, 使用转接口时,外部接口调用前不会做登录验证
keepPassword      -- 记住密码,默认开启,当值为 false 时禁用
keepPwd           -- 记住密码,默认开启,当值为 false 时禁用,当值为 invisible 时记住密码但密码不可查看
execType          -- 脚本传输方式,值为x时,启用AES加密
updateStatus      -- 是否更新开发状态,默认开启,当值为 false 时禁用
forcedUpdate      -- 传输号升级时,是否自动退出,格式为(YYYY-MM-DD),用于升级后刷新用户本地配置
public/options.json
@@ -18,7 +18,7 @@
  "storeKey": "",
  "probation": "",
  "transfer": "true",
  "keepPassword": "true",
  "keepPwd": "true",
  "host": "http://bms-test.kresstools.cn",
  "service": "oc/"
}
src/api/index.js
@@ -1047,7 +1047,15 @@
        data: param
      }).then(res => {
        if (res.status && res.urlPath) {
          res.urlPath = window.GLOB.baseurl + res.urlPath
          if (!/Content\/images/.test(res.urlPath)) {
            let key = CryptoJS.enc.Utf8.parse('D1185ED7B32568C9')
            let wordArray = CryptoJS.enc.Base64.parse(res.urlPath)
            let decryptedWordArray = CryptoJS.AES.decrypt({ ciphertext: wordArray }, key, { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7 })
            res.urlPath = CryptoJS.enc.Utf8.stringify(decryptedWordArray)
          }
          if (!/^http/.test(res.urlPath)) {
            res.urlPath = window.GLOB.baseurl + res.urlPath
          }
        }
        resolve(res)
      })
src/components/header/loginform.jsx
@@ -12,9 +12,9 @@
  state = {
    remember: false,
    lock: false,
    username: '',
    password: '',
    oripassword: '',
    delay: +sessionStorage.getItem('mkDelay')
  }
@@ -39,22 +39,17 @@
      this.setState({
        remember: true,
        username: _user.username,
        password: _user.password ? '*********' : '',
        oripassword: _user.password
        password: _user.password,
        lock: true
      })
    }
  }
  handleConfirm = () => {
    const { oripassword } = this.state
    // 表单提交时检查输入值是否正确
    return new Promise((resolve, reject) => {
      this.props.form.validateFieldsAndScroll((err, values) => {
        if (!err) {
          if (oripassword && values.password === '*********') {
            values.password = oripassword
          }
          values.username = values.username.replace(/\t+|\v+|\s+/g, '')
          values.password = values.password.replace(/\t+|\v+|\s+/g, '')
@@ -88,6 +83,12 @@
    }
  }
  unLock = (e) => {
    if (e.target.value) return
    this.setState({ lock: false })
  }
  componentDidMount () {
    const { username, password } = this.state
@@ -102,7 +103,7 @@
  render() {
    const { getFieldDecorator } = this.props.form
    const { remember, username, password, delay } = this.state
    const { remember, username, password, delay, lock } = this.state
    return (
      <Form style={{margin: '0px 10px'}}>
@@ -131,7 +132,7 @@
                message: '请输入密码',
              }
            ]
          })(<Input.Password onPressEnter={(e) => {this.handleSubmit(e, 'username')}} placeholder="密码" prefix={<LockOutlined style={{ color: 'rgba(0,0,0,.25)' }} />} />)}
          })(<Input.Password onPressEnter={(e) => {this.handleSubmit(e, 'username')}} placeholder="密码" visibilityToggle={!lock} onChange={this.unLock} prefix={<LockOutlined style={{ color: 'rgba(0,0,0,.25)' }} />} />)}
        </Form.Item>
        {window.GLOB.keepKey ? <Form.Item style={{marginBottom: '10px'}}>
          {getFieldDecorator('remember', {
src/index.js
@@ -37,6 +37,8 @@
      }
    }
    config.keepPwd = config.keepPwd || config.keepPassword
    let GLOB = {}
    GLOB.appId = config.appId || ''
    GLOB.lineColor = config.lineColor || ''
@@ -44,7 +46,8 @@
    GLOB.probation = false
    GLOB.watermark = config.watermark + '' !== 'false'
    GLOB.transfer = config.transfer + '' === 'true'
    GLOB.keepKey = config.keepPassword + '' !== 'false'
    GLOB.keepKey = config.keepPwd + '' !== 'false'
    GLOB.vispwd = config.keepPwd + '' !== 'invisible'
    GLOB.WXAppID = config.WXAppID || ''
    GLOB.WXminiAppID = config.WXminiAppID || ''
    GLOB.WXMerchID = config.WXMerchID || ''
src/menu/datasource/index.jsx
@@ -288,6 +288,12 @@
    })
  }
  cancel = () => {
    this.verifyRef.closeDataSource(() => {
      this.setState({ visible: false, loading: false })
    })
  }
  creatFunc = () => {
    const { config } = this.props
    const { mainSearch } = this.state
@@ -330,7 +336,7 @@
          onCancel={() => {this.setState({ visible: false, loading: false }) }}
          footer={[
            config.subtype !== 'dualdatacard' && record.interType === 'inner' ? <CreateFunc key="create" getMsg={this.creatFunc}/> : null,
            <Button key="cancel" onClick={() => { this.setState({ visible: false, loading: false }) }}>取消</Button>,
            <Button key="cancel" onClick={this.cancel}>取消</Button>,
            <Button key="confirm" type="primary" loading={loading} onClick={this.verifySubmit}>确定</Button>
          ]}
          destroyOnClose
src/menu/datasource/verifycard/index.jsx
@@ -41,9 +41,8 @@
    loading: false,
    colLoading: false,
    searchKey: '',
    initsql: '',          // sql验证时变量声明及赋值
    usefulfields: '',
    defaultsql: '',       // 默认Sql
    defaultsql: '',
    systemScripts: [],
    median: {},
    visible: false,
@@ -51,6 +50,7 @@
    pvisible: false,
    reload: false,
    script: null,
    oriConfig: null,
    scriptValue: '',
    cols: null,
    colColumns: [
@@ -249,7 +249,13 @@
      median: _setting,
      searches: formatSearch(search),
      searchKey: '',
      debugId: _setting.debugId || ''
      debugId: _setting.debugId || '',
      oriConfig: fromJS({
        scripts,
        columns: columns,
        subColumns: subColumns,
        setting: _setting
      }).toJS()
    })
    this.getsysScript()
@@ -648,6 +654,32 @@
        this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols }) }, reject, 'submit')
      }
    })
  }
  closeDataSource = (callback) => {
    const { setting, columns, subColumns, scripts, oriConfig } = this.state
    let line = scripts.map(item => item.sql).join('')
    line += columns.map(item => item.field + item.datatype).join('')
    line += subColumns.map(item => item.field + item.datatype).join('')
    line += setting.interType + (setting.dataresource || '') + (setting.order || '') + (setting.primaryKey || '')
    let _line = oriConfig.scripts.map(item => item.sql).join('')
    _line += oriConfig.columns.map(item => item.field + item.datatype).join('')
    _line += oriConfig.subColumns.map(item => item.field + item.datatype).join('')
    _line += oriConfig.setting.interType + (oriConfig.setting.dataresource || '') + (oriConfig.setting.order || '') + (oriConfig.setting.primaryKey || '')
    if (line !== _line) {
      confirm({
        content: '数据源已修改,确定取消吗?',
        onOk() {
          callback()
        },
        onCancel() {}
      })
    } else {
      callback()
    }
  }
  sqlverify = (resolve, reject, type, testScripts) => {
@@ -1251,7 +1283,6 @@
              setting={setting}
              searches={searches}
              defaultsql={defaultsql}
              initsql={this.state.initsql}
              customScripts={scripts}
              systemScripts={this.state.systemScripts}
              scriptsChange={this.scriptsChange}
src/pc/components/login/normal-login/loginform.jsx
@@ -157,7 +157,7 @@
            />
          </Form.Item>
          <Form.Item>
            <Input.Password placeholder="密码" prefix={<LockOutlined style={{ color: 'rgba(0,0,0,.25)' }} />} />
            <Input.Password placeholder="密码" visibilityToggle={wrap.vispwd !== 'false'} prefix={<LockOutlined style={{ color: 'rgba(0,0,0,.25)' }} />} />
          </Form.Item>
          {!activeWay.shortcut || activeWay.shortcut === 'remember' ? <Form.Item className="minline">
            <Checkbox>记住密码</Checkbox>
src/pc/components/login/normal-login/options.jsx
@@ -171,6 +171,21 @@
        {value: 'none', label: '无'},
        {value: 'remember', label: '记住密码'},
        {value: 'autologon', label: '自动登录'},
      ],
      controlFields: [
        {field: 'vispwd', values: ['remember', 'autologon']},
      ]
    },
    {
      type: 'radio',
      field: 'vispwd',
      label: '查看密码',
      initval: wrap.vispwd || 'true',
      tooltip: '密码是否可查看(密码框右侧图标是否显示)。',
      required: false,
      options: [
        {value: 'true', label: '启用'},
        {value: 'false', label: '禁用'},
      ]
    },
    {
src/views/login/loginform.jsx
@@ -39,6 +39,7 @@
    verdisabled: false,
    hasScan: false,
    timeout: false,
    vispwd: window.GLOB.vispwd,
    wayLabels: {},
    dict: window.GLOB.dict,
    users: [],
@@ -102,14 +103,14 @@
      users = []
    }
    if (users[0]) {
    if (users[0] && activeKey === 'uname_pwd') {
      _user = users[0]
    }
    this.setState({
      users: users,
      username: activeKey === 'uname_pwd' && _user ? _user.username : '',
      password: activeKey === 'uname_pwd' && _user ? _user.password : '',
      username: _user ? _user.username : '',
      password: _user ? _user.password : '',
      smsId: smsId,
      loginWays: _loginWays,
      activeKey,
@@ -441,7 +442,7 @@
  render() {
    const { langList } = this.props
    const { getFieldDecorator } = this.props.form
    const { activeKey, verdisabled, delay, loginWays, remember, scanId, timeout, hasScan, users, wayLabels, dict, lang } = this.state
    const { activeKey, verdisabled, delay, loginWays, remember, scanId, timeout, hasScan, users, wayLabels, dict, lang, vispwd } = this.state
    return (
      <Form className="login-form" id="login-form" onSubmit={this.handleSubmit}>
@@ -482,7 +483,7 @@
                  message: dict['password_required'] || '请输入密码',
                }
              ]
            })(<Input.Password placeholder={dict['password'] || '密码'} prefix={<LockOutlined style={{ color: 'rgba(0,0,0,.25)' }} />} />)}
            })(<Input.Password placeholder={dict['password'] || '密码'} visibilityToggle={vispwd} prefix={<LockOutlined style={{ color: 'rgba(0,0,0,.25)' }} />} />)}
          </Form.Item>
          {window.GLOB.keepKey ? <Form.Item className="minline">
            {getFieldDecorator('remember', {