king
2022-04-26 5046d0d13dc6a8563b8e54e31913bc44cfa1072f
src/templates/zshare/pasteform/index.jsx
@@ -27,9 +27,23 @@
      this.props.form.validateFieldsAndScroll((err, values) => {
        if (!err) {
          let _config = values.config
          try {
            _config = JSON.parse(window.decodeURIComponent(window.atob(_config)))
            if (typeof(_config) === 'object' && _config.$srcId) {
              let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId')
              if (srcid && _config.$srcId !== srcid) {
                notification.warning({
                  top: 92,
                  message: '当前系统无权限使用此项配置!',
                  duration: 5
                })
                _config = ''
              } else {
                delete _config.$srcId
              }
            }
          } catch (e) {
            notification.warning({
              top: 92,
@@ -47,14 +61,6 @@
        }
      })
    })
  }
  submit = () => {
    if (this.props.inputSubmit) {
      setTimeout(() => {
        this.props.inputSubmit()
      }, 10)
    }
  }
  render() {
@@ -82,7 +88,7 @@
                    message: '请输入配置信息!'
                  }
                ]
              })(<TextArea autoSize={{ minRows: 6, maxRows: 6 }} onPressEnter={this.submit}/>)}
              })(<TextArea autoSize={{ minRows: 6, maxRows: 6 }}/>)}
            </Form.Item>
          </Col>
        </Row>