From 915bf69e6f323cc2fb9db917a415c713a8aa5c2a Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Wed, 1 Dec 2021 11:06:10 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=90=8D=E7=89=B9=E6=AE=8A?=
=?UTF-8?q?=E5=AD=97=E7=AC=A6=E5=88=A4=E6=96=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/forge/Newfile/Index.js | 43 ++++++++++++++++++++----
src/forge/Newfile/UserSubmitComponent.js | 8 ++---
src/forge/Newfile/index.css | 8 +++++
src/forge/Newfile/m_editor.js | 3 +-
4 files changed, 51 insertions(+), 11 deletions(-)
diff --git a/src/forge/Newfile/Index.js b/src/forge/Newfile/Index.js
index 953f5072..31ef5865 100644
--- a/src/forge/Newfile/Index.js
+++ b/src/forge/Newfile/Index.js
@@ -10,7 +10,8 @@ class Index extends Component {
this.state = {
editorValue: "",
filename: "",
- language: undefined
+ language: undefined,
+ checkName:false
};
}
@@ -26,16 +27,43 @@ class Index extends Component {
};
select_language = (e) => {
- console.log(e)
this.setState({
language: e
})
}
+ checkFileName=(e)=>{
+ let value = (e.target.value);
+ //\需要单独判断
+ const str = '!!@/::"“”<《》>||??%';
+ let reg = /\\/g;
+ if(reg.test(value)){
+ this.setState({
+ checkName:true
+ })
+ }else{
+ for(var i=0;i