king
2023-01-13 7adf0212cd71a8ec604f65ba2c2e9bdfc5dec22d
src/components/keyInterface/index.jsx
@@ -19,6 +19,7 @@
    url: '',
    key: '',
    visible: false,
    apptoken: '',
    setting: null
  }
@@ -104,7 +105,7 @@
            return
          }
        }
        this.setState({key: key, setting: _setting})
        this.setState({key: key, apptoken: values.apptoken, setting: _setting})
        return
      }
@@ -136,7 +137,7 @@
      this.props.onChange(content)
      this.setState({setting: message, url: values.interface, visible: false})
      this.setState({setting: message, url: values.interface, apptoken: '', visible: false})
      if (this.props.type !== 'develop') {
        this.setState({key: ''})
@@ -153,7 +154,7 @@
    if (type === 'develop') {
      this.setState({setting: null, url: ''})
    } else {
      this.setState({key: '', setting: null, url: ''})
      this.setState({key: '', apptoken: '', setting: null, url: ''})
    }
    this.props.onChange('')
@@ -163,14 +164,15 @@
    const { type } = this.props
    if (type !== 'develop') {
      this.setState({key: ''})
      this.setState({key: '', apptoken: ''})
    }
    this.setState({visible: false})
  }
  render() {
    const { type } = this.props
    const { getFieldDecorator } = this.props.form
    const { url, visible, setting, key } = this.state
    const { url, visible, setting, key, apptoken } = this.state
    return (
      <div className="mk-key-wrap">
@@ -191,6 +193,9 @@
        >
          {key && setting ?
            <Form>
              {apptoken && type !== 'develop' ? <Form.Item style={{color: 'red'}} label="正式系统appkey">
                {apptoken}
              </Form.Item> : null}
              <Form.Item label="接口地址">
                {getFieldDecorator('interface', {
                  initialValue: setting.interface || 'http://******/webapi/dostars',
@@ -217,7 +222,7 @@
                  ]
                })(<TextArea placeholder="http://sso.mk9h.cn/cloud/webapi/dostars" rows={2}/>)}
              </Form.Item>
              <Form.Item label="appkey">
              <Form.Item label="目标系统appkey">
                {getFieldDecorator('appkey', {
                  initialValue: setting.appkey || '',
                  rules: [
@@ -282,7 +287,7 @@
              </Form.Item>
            </Form> : null}
          {!key ? <Form style={{marginTop: '20px', marginBottom: '50px'}}>
            <Form.Item label="appkey">
            <Form.Item label="正式系统appkey">
              {getFieldDecorator('apptoken', {
                initialValue: '',
                rules: [