| | |
| | | import qs from 'qs' |
| | | import { notification } from 'antd' |
| | | import md5 from 'md5' |
| | | import CryptoJS from 'crypto-js' |
| | | import jsSHA from 'jssha' |
| | | import moment from 'moment' |
| | | import Utils from '@/utils/utils.js' |
| | |
| | | |
| | | window.GLOB.WebSql = null |
| | | window.GLOB.IndexDB = null |
| | | window.GLOB.OuterToken = {} |
| | | const systemMenuKeys = `1581067625930haged11ieaivpavv77k,1581734956310scks442ul2d955g9tu5,1583991994144ndddg0bhh0is6shi0v1,1583979633842550imkchl4qt4qppsiv,1578900109100np8aqd0a77q3na46oas, |
| | | 1585192949946f3et2ts8tn82krmumdf,15855615451212m12ip23vpcm79kloro,1587005717541lov40vg61q7l1rbveon,1590458676585agbbr63t6ihighg2i1g,1602315375262ikd33ii0nii34pt861o,1582771068837vsv54a089lgp45migbg, |
| | | 1582777675954ifu05upurs465omoth7,158294809668898cklbv6c5bou8e1fpu,1584676379094iktph45fb8imhg96bql,1584695125339vo5g7iqgfn01qmrd6s2,1584699661372vhmpp9dn9foo0eob722,15848421131551gg04ie8sitsd3f7467, |
| | |
| | | } |
| | | } |
| | | |
| | | visitOuterSystem (param, _resolve) { |
| | | let token = param.$token |
| | | delete param.$token |
| | | |
| | | try { |
| | | token = JSON.parse(token) |
| | | token = token.message |
| | | |
| | | const key = CryptoJS.enc.Utf8.parse(window.GLOB.appkey.slice(-16)) |
| | | const iv = CryptoJS.enc.Utf8.parse('mksoft') |
| | | |
| | | let encryptedHexStr = CryptoJS.enc.Hex.parse(token) |
| | | let _srcs = CryptoJS.enc.Base64.stringify(encryptedHexStr) |
| | | let decrypt = CryptoJS.AES.decrypt(_srcs, key, { iv: iv, mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7 }) |
| | | let decryptedStr = decrypt.toString(CryptoJS.enc.Utf8) |
| | | token = decryptedStr.toString() |
| | | |
| | | token = JSON.parse(window.decodeURIComponent(window.atob(token))) |
| | | } catch (e) { |
| | | token = null |
| | | _resolve({status: false, ErrCode: 'E', message: '接口信息解析失败!'}) |
| | | } |
| | | |
| | | if (!token) return |
| | | |
| | | let userid = '' |
| | | let loginUid = '' |
| | | let dataM = '' |
| | | |
| | | if (window.GLOB.OuterToken[token.interface]) { |
| | | let msg = window.GLOB.OuterToken[token.interface] |
| | | |
| | | let seconds = Math.floor((new Date().getTime() - msg.timestamp) / 1000) |
| | | if (seconds >= 3600) { |
| | | delete window.GLOB.OuterToken[token.interface] |
| | | } else { |
| | | userid = msg.userid |
| | | loginUid = msg.loginUid |
| | | dataM = msg.dataM || '' |
| | | } |
| | | } |
| | | |
| | | // param.appkey = token.appkey || '' |
| | | |
| | | if (userid && loginUid) { |
| | | param.dataM = dataM |
| | | param.userid = userid |
| | | param.LoginUID = loginUid |
| | | param = this.encryptParam(param) |
| | | |
| | | axios({ |
| | | url: token.interface, |
| | | method: 'post', |
| | | data: param |
| | | }).then(res => { |
| | | _resolve(res) |
| | | }) |
| | | } else { |
| | | let _param = { |
| | | UserName: token.username, |
| | | systemType: options.sysType, |
| | | login_city: sessionStorage.getItem('city') || '', |
| | | device_id: localStorage.getItem('SessionUid') |
| | | } |
| | | |
| | | _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | |
| | | _param.Type = token.publicKey |
| | | let shaObj = new jsSHA('SHA-1', 'TEXT') |
| | | shaObj.update(token.password) |
| | | _param.Password = shaObj.getHash('HEX').toUpperCase() |
| | | _param.Password = md5(token.privateKey + token.username + _param.Password + _param.timestamp) |
| | | _param.appkey = token.appkey || '' |
| | | let url = token.interface.replace(/\/webapi(.*)/, '/webapi/dologon') |
| | | |
| | | if (token.ssoInterface) { |
| | | _param.rduri = token.ssoInterface.replace(/\/webapi(.*)/, '/webapi/dologon') |
| | | } |
| | | |
| | | axios({ |
| | | url, |
| | | method: 'post', |
| | | data: _param |
| | | }).then(result => { |
| | | if (result.status) { |
| | | window.GLOB.OuterToken[token.interface] = { |
| | | userid: result.UserID, |
| | | loginUid: result.LoginUID, |
| | | timestamp: new Date().getTime(), |
| | | dataM: result.dataM ? 'Y' : '' |
| | | } |
| | | |
| | | param.dataM = result.dataM ? 'Y' : '' |
| | | param.userid = result.UserID |
| | | param.LoginUID = result.LoginUID |
| | | param = this.encryptParam(param) |
| | | |
| | | axios({ |
| | | url: token.interface, |
| | | method: 'post', |
| | | data: param |
| | | }).then(res => { |
| | | _resolve(res) |
| | | }) |
| | | } else { |
| | | _resolve(result) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @description 获取业务通用接口 |
| | | * 访问 'https://sso.mk9h.cn/webapi/dostars'或云端时,传入userid、LoginUID |
| | |
| | | param.LoginUID = param.LoginUID || sessionStorage.getItem('LoginUID') || '' |
| | | param.appkey = window.GLOB.appkey || '' |
| | | |
| | | if (param.$token === '') { |
| | | return Promise.resolve({status: false, ErrCode: 'E', message: '接口地址尚未设置!'}) |
| | | } else if (param.$token) { |
| | | return new Promise(resolve => this.visitOuterSystem(param, resolve)) |
| | | } |
| | | |
| | | if (['sPC_Get_TableData', 'sPC_Get_TableData_debug', 'sPC_TableData_InUpDe', 'sPC_TableData_InUpDe_debug', 'sPC_Get_structured_data'].includes(param.func)) { |
| | | if (sessionStorage.getItem('isEditState') === 'true') { |
| | | param.username = sessionStorage.getItem('CloudUserName') || '' |
| | |
| | | eye: false |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps(nextProps) { |
| | | if (nextProps.value !== this.props.value) { |
| | | this.setState({eye: false}) |
| | | } |
| | | } |
| | | |
| | | getValue = () => { |
| | | const { value } = this.props |
| | | |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import CryptoJS from 'crypto-js' |
| | | import { Input, Modal, Form, notification } from 'antd' |
| | | import { EditOutlined, DeleteOutlined } from '@ant-design/icons' |
| | | |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | | |
| | | class KeyInterface extends Component { |
| | | static propTpyes = { |
| | | type: PropTypes.string, |
| | | onChange: PropTypes.func |
| | | } |
| | | |
| | | state = { |
| | | url: '', |
| | | key: '', |
| | | visible: false, |
| | | setting: null |
| | | } |
| | | |
| | | componentDidMount() { |
| | | const { value, type } = this.props |
| | | |
| | | if (value) { |
| | | let content = value |
| | | try { |
| | | content = JSON.parse(content) |
| | | } catch (e) { |
| | | content = {} |
| | | } |
| | | |
| | | this.setState({setting: content.message || null, url: content.url || ''}) |
| | | } |
| | | |
| | | if (type === 'develop') { |
| | | this.setState({key: window.GLOB.appkey.slice(-16)}) |
| | | } |
| | | } |
| | | |
| | | editKey = () => { |
| | | let _setting = this.state.setting |
| | | |
| | | if (this.state.key && _setting && typeof(_setting) === 'string') { |
| | | _setting = this.decrypt(this.state.key, _setting) |
| | | } |
| | | |
| | | this.setState({visible: true, setting: _setting || {}}) |
| | | } |
| | | |
| | | decrypt = (token, value) => { |
| | | let setting = null |
| | | try { |
| | | const key = CryptoJS.enc.Utf8.parse(token) |
| | | const iv = CryptoJS.enc.Utf8.parse('mksoft') |
| | | |
| | | let encryptedHexStr = CryptoJS.enc.Hex.parse(value) |
| | | let _srcs = CryptoJS.enc.Base64.stringify(encryptedHexStr) |
| | | let decrypt = CryptoJS.AES.decrypt(_srcs, key, { iv: iv, mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7 }) |
| | | let decryptedStr = decrypt.toString(CryptoJS.enc.Utf8) |
| | | setting = decryptedStr.toString() |
| | | |
| | | setting = JSON.parse(window.decodeURIComponent(window.atob(setting))) |
| | | } catch (e) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '信息解析失败!', |
| | | duration: 5 |
| | | }) |
| | | setting = {} |
| | | } |
| | | |
| | | return setting |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (err) return |
| | | |
| | | if (values.apptoken) { |
| | | let key = values.apptoken.slice(-16) |
| | | let _setting = this.state.setting |
| | | if (_setting && typeof(_setting) === 'string') { |
| | | _setting = this.decrypt(key, _setting) |
| | | } |
| | | this.setState({key: key, setting: _setting}) |
| | | return |
| | | } |
| | | |
| | | if (!/\/dostars$/.test(values.interface)) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '接口地址请填写dostars接口!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (values.ssoInterface && !/\/dostars$/.test(values.ssoInterface)) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: 'sso地址请填写dostars接口!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | let _values = window.btoa(window.encodeURIComponent(JSON.stringify(values))) |
| | | |
| | | const key = CryptoJS.enc.Utf8.parse(this.state.key) |
| | | const iv = CryptoJS.enc.Utf8.parse('mksoft') |
| | | |
| | | let srcs = CryptoJS.enc.Utf8.parse(_values) |
| | | let encrypted = CryptoJS.AES.encrypt(srcs, key, { iv: iv, mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7 }) |
| | | let message = encrypted.ciphertext.toString() |
| | | let content = JSON.stringify({message: message, url: values.interface}) |
| | | |
| | | this.props.onChange(content) |
| | | |
| | | this.setState({setting: message, url: values.interface, visible: false}) |
| | | }) |
| | | } |
| | | |
| | | delKey = () => { |
| | | const { type } = this.props |
| | | |
| | | if (type === 'develop') { |
| | | this.setState({setting: null, url: ''}) |
| | | } else { |
| | | this.setState({key: '', setting: null, url: ''}) |
| | | } |
| | | |
| | | this.props.onChange('') |
| | | } |
| | | |
| | | render() { |
| | | const { getFieldDecorator } = this.props.form |
| | | const { url, visible, setting, key } = this.state |
| | | |
| | | return ( |
| | | <div className="mk-key-wrap"> |
| | | <TextArea value={url} rows={2} readOnly={true}/> |
| | | <div className="mk-key-edit"><EditOutlined onClick={this.editKey}/><DeleteOutlined onClick={this.delKey}/></div> |
| | | <Modal |
| | | wrapClassName='mk-key-modal' |
| | | visible={visible} |
| | | closable={false} |
| | | maskClosable={false} |
| | | width={650} |
| | | onOk={this.handleConfirm} |
| | | onCancel={() => this.setState({visible: false})} |
| | | destroyOnClose |
| | | > |
| | | {key && setting ? |
| | | <Form> |
| | | <Form.Item label="接口地址"> |
| | | {getFieldDecorator('interface', { |
| | | initialValue: setting.interface, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入接口地址!' |
| | | }, |
| | | { |
| | | pattern: /^[0-9a-zA-Z:_./]+$/, |
| | | message: '只可使用英文、数字以及:_./' |
| | | } |
| | | ] |
| | | })(<TextArea rows={2}/>)} |
| | | </Form.Item> |
| | | <Form.Item label="sso地址"> |
| | | {getFieldDecorator('ssoInterface', { |
| | | initialValue: setting.ssoInterface || '', |
| | | rules: [ |
| | | { |
| | | pattern: /^[0-9a-zA-Z:_./]+$/, |
| | | message: '只可使用英文、数字以及:_./' |
| | | } |
| | | ] |
| | | })(<TextArea rows={2}/>)} |
| | | </Form.Item> |
| | | <Form.Item label="appkey"> |
| | | {getFieldDecorator('appkey', { |
| | | initialValue: setting.appkey || '', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入appkey!' |
| | | }, |
| | | { |
| | | pattern: /^[0-9a-zA-Z]+$/, |
| | | message: '只可输入英文及数字。' |
| | | }, |
| | | { |
| | | min: 16, |
| | | message: '不可小于16位!' |
| | | } |
| | | ] |
| | | })(<Input placeholder="请输入appkey" autoComplete="off" />)} |
| | | </Form.Item> |
| | | <Form.Item label="用户名"> |
| | | {getFieldDecorator('username', { |
| | | initialValue: setting.username, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入用户名!' |
| | | } |
| | | ] |
| | | })(<Input placeholder="请输入用户名" autoComplete="off" />)} |
| | | </Form.Item> |
| | | <Form.Item label="密码"> |
| | | {getFieldDecorator('password', { |
| | | initialValue: setting.password, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入密码!' |
| | | } |
| | | ] |
| | | })(<Input.Password placeholder="请输入密码" />)} |
| | | </Form.Item> |
| | | <Form.Item label="公钥"> |
| | | {getFieldDecorator('publicKey', { |
| | | initialValue: setting.publicKey, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入公钥!' |
| | | } |
| | | ] |
| | | })(<Input.Password placeholder={''} autoComplete="off" />)} |
| | | </Form.Item> |
| | | <Form.Item label="私钥"> |
| | | {getFieldDecorator('privateKey', { |
| | | initialValue: setting.privateKey, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入私钥!' |
| | | } |
| | | ] |
| | | })(<Input.Password placeholder={''} autoComplete="off" />)} |
| | | </Form.Item> |
| | | </Form> : null} |
| | | {!key ? <Form style={{marginTop: '20px', marginBottom: '50px'}}> |
| | | <Form.Item label="apptoken"> |
| | | {getFieldDecorator('apptoken', { |
| | | initialValue: '', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入正式系统appkey!' |
| | | }, |
| | | { |
| | | pattern: /^[0-9a-zA-Z]+$/, |
| | | message: '只可输入英文及数字。' |
| | | }, |
| | | { |
| | | min: 16, |
| | | message: '不可小于16位!' |
| | | } |
| | | ] |
| | | })(<Input placeholder="请输入正式系统appkey" autoComplete="off" />)} |
| | | </Form.Item> |
| | | </Form> : null} |
| | | </Modal> |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default Form.create()(KeyInterface) |
New file |
| | |
| | | .mk-key-wrap { |
| | | position: relative; |
| | | margin-bottom: 5px; |
| | | |
| | | .mk-key-edit { |
| | | position: absolute; |
| | | right: 0px; |
| | | line-height: 1; |
| | | |
| | | .anticon { |
| | | margin-left: 10px; |
| | | cursor: pointer; |
| | | padding: 0px 5px; |
| | | } |
| | | .anticon-edit { |
| | | color: #1890ff; |
| | | } |
| | | .anticon-delete { |
| | | color: #f5222d; |
| | | } |
| | | } |
| | | } |
| | | .mk-key-modal { |
| | | .ant-modal { |
| | | top: 85px; |
| | | } |
| | | .ant-modal-body { |
| | | padding-top: 35px; |
| | | padding-bottom: 0px; |
| | | } |
| | | .ant-modal-footer { |
| | | border-top: none; |
| | | text-align: center; |
| | | padding-bottom: 30px; |
| | | button + button { |
| | | margin-left: 15px; |
| | | } |
| | | } |
| | | .ant-form-item { |
| | | display: flex; |
| | | .ant-form-item-label { |
| | | width: 20%; |
| | | } |
| | | .ant-form-item-control-wrapper { |
| | | width: 70%; |
| | | } |
| | | } |
| | | } |
| | |
| | | import { formRule } from '@/utils/option.js' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import KeyInterface from '@/components/keyInterface' |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | |
| | | reReadonly.interface = false |
| | | reRequired.interface = true |
| | | } else if (intertype === 'outer') { |
| | | shows.push('procMode', 'sysInterface', 'interface', 'outerFunc', 'callbackType', 'output') |
| | | shows.push('procMode', 'sysInterface', 'outerFunc', 'callbackType', 'output') |
| | | if (this.record.procMode === 'system') { |
| | | shows.push('sql', 'sqlType') |
| | | } else if (this.record.procMode === 'inner') { |
| | |
| | | reReadonly.interface = false |
| | | reRequired.interface = true |
| | | |
| | | shows.push('proInterface') |
| | | } else { |
| | | shows.push('interface', 'proInterface') |
| | | } else if (this.record.sysInterface === 'true') { |
| | | reReadonly.interface = true |
| | | reRequired.interface = false |
| | | |
| | | shows.push('interface') |
| | | } else if (this.record.sysInterface === 'external') { |
| | | shows.push('exInterface', 'exProInterface') |
| | | } |
| | | } else if (intertype === 'inner') { |
| | | shows.push('innerFunc', 'output') |
| | |
| | | reOptions.intertype = this.state.interTypeOptions.filter(item => item.value !== 'custom') |
| | | |
| | | if (intertype === 'outer') { |
| | | shows.push('procMode', 'sysInterface', 'interface', 'outerFunc', 'callbackType') |
| | | shows.push('procMode', 'sysInterface', 'outerFunc', 'callbackType') |
| | | if (this.record.procMode === 'system') { |
| | | shows.push('sql', 'sqlType') |
| | | } else if (this.record.procMode === 'inner') { |
| | |
| | | reReadonly.interface = false |
| | | reRequired.interface = true |
| | | |
| | | shows.push('proInterface') |
| | | } else { |
| | | shows.push('interface', 'proInterface') |
| | | } else if (this.record.sysInterface === 'true') { |
| | | reReadonly.interface = true |
| | | reRequired.interface = false |
| | | |
| | | shows.push('interface') |
| | | } else if (this.record.sysInterface === 'external') { |
| | | shows.push('exInterface', 'exProInterface') |
| | | } |
| | | } else if (intertype === 'inner') { |
| | | shows.push('innerFunc') |
| | |
| | | reOptions.Ot = requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value)) |
| | | |
| | | if (this.record.intertype === 'outer') { |
| | | shows.push('innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc') |
| | | shows.push('innerFunc', 'sysInterface', 'outerFunc', 'callbackFunc') |
| | | reRequired.innerFunc = false |
| | | reRequired.callbackFunc = false |
| | | |
| | |
| | | reReadonly.interface = false |
| | | reRequired.interface = true |
| | | |
| | | shows.push('proInterface') |
| | | } else { |
| | | shows.push('interface', 'proInterface') |
| | | } else if (this.record.sysInterface === 'true') { |
| | | reReadonly.interface = true |
| | | reRequired.interface = false |
| | | |
| | | shows.push('interface') |
| | | } else if (this.record.sysInterface === 'external') { |
| | | shows.push('exInterface', 'exProInterface') |
| | | } |
| | | } else if (this.record.intertype === 'inner') { |
| | | shows.push('innerFunc') |
| | |
| | | reOptions.intertype = this.state.interTypeOptions.filter(op => op.value !== 'custom') |
| | | |
| | | if (this.record.intertype === 'outer') { |
| | | shows.push('innerFunc', 'sysInterface', 'interface', 'outerFunc') |
| | | shows.push('innerFunc', 'sysInterface', 'outerFunc') |
| | | reRequired.innerFunc = false |
| | | |
| | | if (this.record.sysInterface === 'false') { |
| | | reReadonly.interface = false |
| | | reRequired.interface = true |
| | | |
| | | shows.push('proInterface') |
| | | } else { |
| | | shows.push('interface', 'proInterface') |
| | | } else if (this.record.sysInterface === 'true') { |
| | | reReadonly.interface = true |
| | | reRequired.interface = false |
| | | |
| | | shows.push('interface') |
| | | } else if (this.record.sysInterface === 'external') { |
| | | shows.push('exInterface', 'exProInterface') |
| | | } |
| | | } else if (this.record.intertype === 'inner') { |
| | | shows.push('innerFunc') |
| | |
| | | if (_funcType === 'print') { |
| | | shows.push('execMode', 'intertype', 'Ot', 'execSuccess', 'execError') |
| | | if (this.record.intertype === 'outer') { |
| | | shows.push('innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc') |
| | | shows.push('innerFunc', 'sysInterface', 'outerFunc', 'callbackFunc') |
| | | reRequired.innerFunc = false |
| | | reRequired.callbackFunc = false |
| | | |
| | | if (this.record.sysInterface === 'false') { |
| | | reReadonly.interface = false |
| | | reRequired.interface = true |
| | | |
| | | shows.push('proInterface') |
| | | } else { |
| | | |
| | | shows.push('interface', 'proInterface') |
| | | } else if (this.record.sysInterface === 'true') { |
| | | reReadonly.interface = true |
| | | reRequired.interface = false |
| | | |
| | | shows.push('interface') |
| | | } else if (this.record.sysInterface === 'external') { |
| | | shows.push('exInterface', 'exProInterface') |
| | | } |
| | | } else if (this.record.intertype === 'inner') { |
| | | shows.push('innerFunc') |
| | |
| | | ] |
| | | |
| | | content = <TextArea rows={2} readOnly={item.readonly}/> |
| | | } else if (item.type === 'keyinterface') { |
| | | span = 24 |
| | | className = 'textarea' |
| | | rules = [ |
| | | { required: item.required, message: '请输入' + item.label + '!' } |
| | | ] |
| | | |
| | | content = <KeyInterface type={item.key === 'exInterface' ? 'develop' : 'product'}/> |
| | | } |
| | | |
| | | fields.push( |
| | |
| | | { |
| | | type: 'radio', |
| | | key: 'sysInterface', |
| | | label: '系统接口', |
| | | label: '系统类型', |
| | | initVal: card.sysInterface || 'false', |
| | | tooltip: '单点登录系统', |
| | | tooltip: '业务系统指同一sso下的其他业务系统,外部系统指不同sso下的其他业务系统。', |
| | | required: true, |
| | | options: [{ |
| | | value: 'true', |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: '否' |
| | | text: '业务' |
| | | }, { |
| | | value: 'true', |
| | | text: '单点' |
| | | }, { |
| | | value: 'external', |
| | | text: '外部' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | key: 'proInterface', |
| | | label: '正式地址', |
| | | initVal: card.proInterface || '', |
| | | tooltip: '正式系统所使用的接口地址。', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'keyinterface', |
| | | key: 'exInterface', |
| | | label: '测试地址', |
| | | initVal: card.exInterface || '', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'keyinterface', |
| | | key: 'exProInterface', |
| | | label: '正式地址', |
| | | initVal: card.exProInterface || '', |
| | | tooltip: '正式系统所使用的接口地址。', |
| | | required: false |
| | | }, |
| | |
| | | { |
| | | type: 'radio', |
| | | key: 'sysInterface', |
| | | label: '系统接口', |
| | | label: '系统类型', |
| | | initVal: card.sysInterface || 'false', |
| | | tooltip: '单点登录系统', |
| | | tooltip: '业务系统指同一sso下的其他业务系统,外部系统指不同sso下的其他业务系统。', |
| | | required: true, |
| | | options: [{ |
| | | value: 'true', |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: '否' |
| | | text: '业务' |
| | | }, { |
| | | value: 'true', |
| | | text: '单点' |
| | | }, { |
| | | value: 'external', |
| | | text: '外部' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'keyinterface', |
| | | key: 'exInterface', |
| | | label: '测试地址', |
| | | initVal: card.exInterface || '', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'keyinterface', |
| | | key: 'exProInterface', |
| | | label: '正式地址', |
| | | initVal: card.exProInterface || '', |
| | | tooltip: '正式系统所使用的接口地址。', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'method', |
| | | label: '请求方式', |
| | |
| | | import Utils from '@/utils/utils.js' |
| | | import MenuUtils from '@/utils/utils-custom.js' |
| | | import CodeMirror from '@/templates/zshare/codemirror' |
| | | import KeyInterface from '@/components/keyInterface' |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | |
| | | </Col> |
| | | {setting.interType === 'outer' ? <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="单点登录系统"> |
| | | <Tooltip placement="topLeft" title="业务系统指同一sso下的其他业务系统,外部系统指不同sso下的其他业务系统。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 系统接口 |
| | | 系统类型 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('sysInterface', { |
| | |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请选择是否使用系统接口!' |
| | | message: '请选择系统类型!' |
| | | } |
| | | ] |
| | | })( |
| | | <Radio.Group onChange={(e) => {this.onOptionChange(e.target.value, 'sysInterface')}}> |
| | | <Radio value="true">是</Radio> |
| | | <Radio value="false">否</Radio> |
| | | <Radio value="false">业务</Radio> |
| | | <Radio value="true">单点</Radio> |
| | | <Radio value="external">外部</Radio> |
| | | </Radio.Group>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | |
| | | })(<Input placeholder={''} autoComplete="off" />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {setting.interType === 'outer' ? <Col className="outer-interface" span={24}> |
| | | {setting.interType === 'outer' && setting.sysInterface !== 'external' ? <Col className="outer-interface" span={24}> |
| | | <Form.Item label="接口地址"> |
| | | {getFieldDecorator('interface', { |
| | | initialValue: setting.interface || (setting.sysInterface === 'true' ? window.GLOB.mainSystemApi : ''), |
| | |
| | | })(<TextArea rows={2} readOnly={setting.sysInterface === 'true'}/>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {setting.interType === 'outer' && setting.sysInterface !== 'true' ? <Col className="outer-interface" span={24}> |
| | | <Form.Item label={<Tooltip placement="topLeft" title="正式系统接口地址,为空时使用接口地址"> |
| | | {setting.interType === 'outer' && setting.sysInterface === 'external' ? <Col className="outer-interface" span={24}> |
| | | <Form.Item label="接口地址"> |
| | | {getFieldDecorator('exInterface', { |
| | | initialValue: setting.exInterface, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请编辑接口地址!' |
| | | } |
| | | ] |
| | | })(<KeyInterface type="develop"/>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {setting.interType === 'outer' && setting.sysInterface === 'false' ? <Col className="outer-interface" span={24}> |
| | | <Form.Item label={<Tooltip placement="topLeft" title="正式系统接口地址,为空时使用接口地址。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 正式地址 |
| | | </Tooltip> |
| | |
| | | })(<TextArea rows={2}/>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {setting.interType === 'outer' && setting.sysInterface === 'external' ? <Col className="outer-interface" span={24}> |
| | | <Form.Item label={<Tooltip placement="topLeft" title="正式系统接口地址。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 正式地址 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('exProInterface', { |
| | | initialValue: setting.exProInterface || '' |
| | | })(<KeyInterface type="product"/>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {setting.interType === 'outer' ? <Col span={8}> |
| | | <Form.Item label="外部函数"> |
| | | {getFieldDecorator('outerFunc', { |
| | |
| | | } |
| | | } |
| | | } else { |
| | | if (btn.sysInterface === 'true' && window.GLOB.mainSystemApi) { |
| | | param.rduri = window.GLOB.mainSystemApi |
| | | } else if (btn.sysInterface !== 'true') { |
| | | if (btn.sysInterface === 'true') { |
| | | if (window.GLOB.mainSystemApi) { |
| | | param.rduri = window.GLOB.mainSystemApi |
| | | } |
| | | } else if (btn.sysInterface === 'external') { |
| | | if (window.GLOB.systemType === 'production') { |
| | | param.$token = btn.exProInterface || '' |
| | | } else { |
| | | param.$token = btn.exInterface || '' |
| | | } |
| | | } else { |
| | | if (window.GLOB.systemType === 'production' && btn.proInterface) { |
| | | param.rduri = btn.proInterface |
| | | } else { |
| | |
| | | } |
| | | } |
| | | } else { |
| | | if (btn.sysInterface === 'true' && window.GLOB.mainSystemApi) { |
| | | param.rduri = window.GLOB.mainSystemApi |
| | | } else if (btn.sysInterface !== 'true') { |
| | | if (btn.sysInterface === 'true') { |
| | | if (window.GLOB.mainSystemApi) { |
| | | param.rduri = window.GLOB.mainSystemApi |
| | | } |
| | | } else if (btn.sysInterface === 'external') { |
| | | if (window.GLOB.systemType === 'production') { |
| | | param.$token = btn.exProInterface || '' |
| | | } else { |
| | | param.$token = btn.exInterface || '' |
| | | } |
| | | } else { |
| | | if (window.GLOB.systemType === 'production' && btn.proInterface) { |
| | | param.rduri = btn.proInterface |
| | | } else { |
| | |
| | | } |
| | | } |
| | | } else { |
| | | if (btn.sysInterface === 'true' && window.GLOB.mainSystemApi) { |
| | | res.rduri = window.GLOB.mainSystemApi |
| | | } else if (btn.sysInterface !== 'true') { |
| | | if (btn.sysInterface === 'true') { |
| | | if (window.GLOB.mainSystemApi) { |
| | | res.rduri = window.GLOB.mainSystemApi |
| | | } |
| | | } else if (btn.sysInterface === 'external') { |
| | | if (window.GLOB.systemType === 'production') { |
| | | res.$token = btn.exProInterface || '' |
| | | } else { |
| | | res.$token = btn.exInterface || '' |
| | | } |
| | | } else { |
| | | if (window.GLOB.systemType === 'production' && btn.proInterface) { |
| | | res.rduri = btn.proInterface |
| | | } else { |
| | |
| | | } |
| | | } |
| | | } else { |
| | | if (btn.sysInterface === 'true' && window.GLOB.mainSystemApi) { |
| | | res.rduri = window.GLOB.mainSystemApi |
| | | } else if (btn.sysInterface !== 'true') { |
| | | if (btn.sysInterface === 'true') { |
| | | if (window.GLOB.mainSystemApi) { |
| | | res.rduri = window.GLOB.mainSystemApi |
| | | } |
| | | } else if (btn.sysInterface === 'external') { |
| | | if (window.GLOB.systemType === 'production') { |
| | | res.$token = btn.exProInterface || '' |
| | | } else { |
| | | res.$token = btn.exInterface || '' |
| | | } |
| | | } else { |
| | | if (window.GLOB.systemType === 'production' && btn.proInterface) { |
| | | res.rduri = btn.proInterface |
| | | } else { |
| | |
| | | } |
| | | } |
| | | } else { |
| | | if (btn.sysInterface === 'true' && window.GLOB.mainSystemApi) { |
| | | param.rduri = window.GLOB.mainSystemApi |
| | | } else if (btn.sysInterface !== 'true') { |
| | | if (btn.sysInterface === 'true') { |
| | | if (window.GLOB.mainSystemApi) { |
| | | param.rduri = window.GLOB.mainSystemApi |
| | | } |
| | | } else if (btn.sysInterface === 'external') { |
| | | if (window.GLOB.systemType === 'production') { |
| | | param.$token = btn.exProInterface || '' |
| | | } else { |
| | | param.$token = btn.exInterface || '' |
| | | } |
| | | } else { |
| | | if (window.GLOB.systemType === 'production' && btn.proInterface) { |
| | | param.rduri = btn.proInterface |
| | | } else { |
| | |
| | | result.open_key = Utils.encryptOpenKey(result.secretkey, result.timestamp) |
| | | } |
| | | } else { |
| | | if (btn.sysInterface === 'true' && window.GLOB.mainSystemApi) { |
| | | result.rduri = window.GLOB.mainSystemApi |
| | | } else if (btn.sysInterface !== 'true') { |
| | | if (btn.sysInterface === 'true') { |
| | | if (window.GLOB.mainSystemApi) { |
| | | result.rduri = window.GLOB.mainSystemApi |
| | | } |
| | | } else if (btn.sysInterface === 'external') { |
| | | if (window.GLOB.systemType === 'production') { |
| | | result.$token = btn.exProInterface || '' |
| | | } else { |
| | | result.$token = btn.exInterface || '' |
| | | } |
| | | } else { |
| | | if (window.GLOB.systemType === 'production' && btn.proInterface) { |
| | | result.rduri = btn.proInterface |
| | | } else { |
| | |
| | | } |
| | | } |
| | | } else { |
| | | if (btn.sysInterface === 'true' && window.GLOB.mainSystemApi) { |
| | | res.rduri = window.GLOB.mainSystemApi |
| | | } else if (btn.sysInterface !== 'true') { |
| | | if (btn.sysInterface === 'true') { |
| | | if (window.GLOB.mainSystemApi) { |
| | | res.rduri = window.GLOB.mainSystemApi |
| | | } |
| | | } else if (btn.sysInterface === 'external') { |
| | | if (window.GLOB.systemType === 'production') { |
| | | res.$token = btn.exProInterface || '' |
| | | } else { |
| | | res.$token = btn.exInterface || '' |
| | | } |
| | | } else { |
| | | if (window.GLOB.systemType === 'production' && btn.proInterface) { |
| | | res.rduri = btn.proInterface |
| | | } else { |
| | |
| | | param.rduri = setting.interface |
| | | } |
| | | } else { |
| | | if (setting.sysInterface === 'true' && window.GLOB.mainSystemApi) { |
| | | param.rduri = window.GLOB.mainSystemApi |
| | | } else if (setting.sysInterface !== 'true') { |
| | | if (setting.sysInterface === 'true') { |
| | | if (window.GLOB.mainSystemApi) { |
| | | param.rduri = window.GLOB.mainSystemApi |
| | | } |
| | | } else if (setting.sysInterface === 'external') { |
| | | if (window.GLOB.systemType === 'production') { |
| | | param.$token = setting.exProInterface || '' |
| | | } else { |
| | | param.$token = setting.exInterface || '' |
| | | } |
| | | } else { |
| | | if (window.GLOB.systemType === 'production' && setting.proInterface) { |
| | | param.rduri = setting.proInterface |
| | | } else { |