From cb9ade2afd2a367ad767bc605ab7086c695dd010 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 09 十二月 2022 15:53:32 +0800
Subject: [PATCH] 2022-12-09

---
 src/templates/zshare/pasteform/index.jsx |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/src/templates/zshare/pasteform/index.jsx b/src/templates/zshare/pasteform/index.jsx
index 6b5cd34..2facaa2 100644
--- a/src/templates/zshare/pasteform/index.jsx
+++ b/src/templates/zshare/pasteform/index.jsx
@@ -26,7 +26,17 @@
     return new Promise((resolve, reject) => {
       this.props.form.validateFieldsAndScroll((err, values) => {
         if (!err) {
-          let _config = values.config
+          let _config = values.config.replace(/(\n|\s)+/g, '')
+
+          if (!_config) {
+            notification.warning({
+              top: 92,
+              message: '璇疯緭鍏ラ厤缃俊鎭�',
+              duration: 5
+            })
+            reject()
+            return
+          }
           try {
             _config = JSON.parse(window.decodeURIComponent(window.atob(_config)))
 
@@ -63,6 +73,14 @@
     })
   }
 
+  enterPress = (e) => {
+    e.stopPropagation()
+
+    setTimeout(() => {
+      this.props.inputSubmit && this.props.inputSubmit()
+    }, 200)
+  }
+
   render() {
     const { getFieldDecorator } = this.props.form
     const formItemLayout = {
@@ -88,7 +106,7 @@
                     message: '璇疯緭鍏ラ厤缃俊鎭�!'
                   }
                 ]
-              })(<TextArea autoSize={{ minRows: 6, maxRows: 6 }}/>)}
+              })(<TextArea autoSize={{ minRows: 6, maxRows: 6 }} onPressEnter={this.enterPress}/>)}
             </Form.Item>
           </Col>
         </Row>

--
Gitblit v1.8.0