| | |
| | | url: '', |
| | | key: '', |
| | | visible: false, |
| | | apptoken: '', |
| | | setting: null |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | this.setState({visible: true, setting: _setting || {}}) |
| | | this.setState({visible: true, setting: _setting || {ssoInterface: 'http://sso.mk9h.cn/cloud/webapi/dostars'}}) |
| | | } |
| | | |
| | | decrypt = (token, value) => { |
| | |
| | | return |
| | | } |
| | | } |
| | | this.setState({key: key, setting: _setting}) |
| | | this.setState({key: key, apptoken: values.apptoken, setting: _setting}) |
| | | return |
| | | } |
| | | |
| | |
| | | |
| | | 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: ''}) |
| | |
| | | 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('') |
| | |
| | | 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"> |
| | |
| | | > |
| | | {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, |
| | | initialValue: setting.interface || 'http://******/webapi/dostars', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | message: '只可使用英文、数字以及:_./' |
| | | } |
| | | ] |
| | | })(<TextArea rows={2}/>)} |
| | | })(<TextArea placeholder="http://******/webapi/dostars" rows={2}/>)} |
| | | </Form.Item> |
| | | <Form.Item label="sso地址"> |
| | | {getFieldDecorator('ssoInterface', { |
| | |
| | | message: '只可使用英文、数字以及:_./' |
| | | } |
| | | ] |
| | | })(<TextArea rows={2}/>)} |
| | | })(<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: [ |
| | |
| | | </Form.Item> |
| | | </Form> : null} |
| | | {!key ? <Form style={{marginTop: '20px', marginBottom: '50px'}}> |
| | | <Form.Item label="appkey"> |
| | | <Form.Item label="正式系统appkey"> |
| | | {getFieldDecorator('apptoken', { |
| | | initialValue: '', |
| | | rules: [ |