分支名可包含/

This commit is contained in:
caishi 2023-08-30 10:17:03 +08:00
parent 04014eb2ff
commit d6ac3631c7
5 changed files with 77 additions and 12 deletions

68
package-lock.json generated
View File

@ -1171,7 +1171,7 @@
},
"raf": {
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz",
"resolved": "http://173.15.15.82:8081/repository/npm-all/raf/-/raf-3.4.1.tgz",
"integrity": "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==",
"requires": {
"performance-now": "^2.1.0"
@ -1190,7 +1190,7 @@
},
"rc-rate": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/rc-rate/-/rc-rate-2.5.1.tgz",
"resolved": "http://173.15.15.82:8081/repository/npm-all/rc-rate/-/rc-rate-2.5.1.tgz",
"integrity": "sha512-3iJkNJT8xlHklPCdeZtUZmJmRVUbr6AHRlfSsztfYTXVlHrv2TcPn3XkHsH+12j812WVB7gvilS2j3+ffjUHXg==",
"requires": {
"classnames": "^2.2.5",
@ -1201,7 +1201,7 @@
},
"rc-select": {
"version": "9.2.3",
"resolved": "https://registry.npmjs.org/rc-select/-/rc-select-9.2.3.tgz",
"resolved": "http://173.15.15.82:8081/repository/npm-all/rc-select/-/rc-select-9.2.3.tgz",
"integrity": "sha512-WhswxOMWiNnkXRbxyrj0kiIvyCfo/BaRPaYbsDetSIAU2yEDwKHF798blCP5u86KLOBKBvtxWLFCkSsQw1so5w==",
"requires": {
"babel-runtime": "^6.23.0",
@ -1220,7 +1220,7 @@
},
"rc-tree": {
"version": "2.1.4",
"resolved": "https://registry.npmjs.org/rc-tree/-/rc-tree-2.1.4.tgz",
"resolved": "http://173.15.15.82:8081/repository/npm-all/rc-tree/-/rc-tree-2.1.4.tgz",
"integrity": "sha512-Xey794Iavgs8YldFlXcZLOhfcIhlX5Oz/yfKufknBXf2AlZCOkc7aHqSM9uTF7fBPtTGPhPxNEfOqHfY7b7xng==",
"requires": {
"@ant-design/create-react-context": "^0.2.4",
@ -8694,6 +8694,14 @@
}
}
},
"html-parse-stringify": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/html-parse-stringify/-/html-parse-stringify-3.0.1.tgz",
"integrity": "sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==",
"requires": {
"void-elements": "3.1.0"
}
},
"html-webpack-plugin": {
"version": "4.5.2",
"resolved": "http://173.15.15.82:8081/repository/npm-all/html-webpack-plugin/-/html-webpack-plugin-4.5.2.tgz",
@ -9140,6 +9148,29 @@
"resolved": "http://173.15.15.82:8081/repository/npm-all/hyphenate-style-name/-/hyphenate-style-name-1.0.4.tgz",
"integrity": "sha512-ygGZLjmXfPHj+ZWh6LwbC37l43MhfztxetbFCoYTM2VjkIUpeHgSNn7QIyVFj7YQ1Wl9Cbw5sholVJPzWvC2MQ=="
},
"i18next": {
"version": "23.4.5",
"resolved": "https://registry.npmmirror.com/i18next/-/i18next-23.4.5.tgz",
"integrity": "sha512-XXALnva7/5H+kg7TjDsmzY3jRypuSJvjR1eUWtt11yUgsOqjZFq/mnaujJ/XpVWhUJU75QhCUhrZqAarlYpOSQ==",
"requires": {
"@babel/runtime": "^7.22.5"
},
"dependencies": {
"@babel/runtime": {
"version": "7.22.11",
"resolved": "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.22.11.tgz",
"integrity": "sha512-ee7jVNlWN09+KftVOu9n7S8gQzD/Z6hN/I8VBRXW4P1+Xe7kJGXMwu8vds4aGIMHZnNbdpSWCfZZtinytpcAvA==",
"requires": {
"regenerator-runtime": "^0.14.0"
}
},
"regenerator-runtime": {
"version": "0.14.0",
"resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz",
"integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA=="
}
}
},
"iconv-lite": {
"version": "0.6.3",
"resolved": "http://173.15.15.82:8081/repository/npm-all/iconv-lite/-/iconv-lite-0.6.3.tgz",
@ -14850,6 +14881,30 @@
}
}
},
"react-i18next": {
"version": "13.2.0",
"resolved": "https://registry.npmmirror.com/react-i18next/-/react-i18next-13.2.0.tgz",
"integrity": "sha512-YD8xMc+I0jkHHLotd8ERMzZ53hMaCBVLCndbcbBveJn3FbppRP4jyYOAkmR8XItN01sTD9ilAjoEjpH1i42IgA==",
"requires": {
"@babel/runtime": "^7.22.5",
"html-parse-stringify": "^3.0.1"
},
"dependencies": {
"@babel/runtime": {
"version": "7.22.11",
"resolved": "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.22.11.tgz",
"integrity": "sha512-ee7jVNlWN09+KftVOu9n7S8gQzD/Z6hN/I8VBRXW4P1+Xe7kJGXMwu8vds4aGIMHZnNbdpSWCfZZtinytpcAvA==",
"requires": {
"regenerator-runtime": "^0.14.0"
}
},
"regenerator-runtime": {
"version": "0.14.0",
"resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz",
"integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA=="
}
}
},
"react-infinite-scroller": {
"version": "1.2.6",
"resolved": "https://registry.npmjs.org/react-infinite-scroller/-/react-infinite-scroller-1.2.6.tgz",
@ -19166,6 +19221,11 @@
"integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==",
"dev": true
},
"void-elements": {
"version": "3.1.0",
"resolved": "https://registry.npmmirror.com/void-elements/-/void-elements-3.1.0.tgz",
"integrity": "sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w=="
},
"w3c-hr-time": {
"version": "1.0.2",
"resolved": "http://173.15.15.82:8081/repository/npm-all/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz",

View File

@ -27,6 +27,7 @@
"editor.md": "^1.5.0",
"flv.js": "^1.5.0",
"fs-extra": "3.0.1",
"i18next": "^23.4.5",
"immutability-helper": "^2.6.6",
"install": "^0.12.2",
"intersection-observer": "^0.12.2",
@ -77,6 +78,7 @@
"react-dev-utils": "^9.2.0-next.80",
"react-dom": "^16.13.1",
"react-hot-loader": "^4.12.20",
"react-i18next": "^13.2.0",
"react-infinite-scroller": "^1.2.4",
"react-loadable": "^5.3.1",
"react-monaco-editor": "0.37",

View File

@ -216,15 +216,15 @@ function Index(props) {
setNewBranchError(undefined);
const value = e.target.value;
if (value) {
const str = '^*/';
const str = '^*';
let reg = /\\/g;
if(reg.test(value)){
setNewBranchError('分支名不能包含下列任何字符:^ * \\ /');
setNewBranchError('分支名不能包含下列任何字符:^ * \\ ');
}else{
for(var i=0;i<str.length;i++){
let s = str[i];
if(value.indexOf(s) > -1){
setNewBranchError('分支名不能包含下列任何字符:^ * \\ /');
setNewBranchError('分支名不能包含下列任何字符:^ * \\ ');
return;
}else{
setNewBranchName(e.target.value);

View File

@ -3,6 +3,7 @@ import { Link } from 'react-router-dom';
import { Input , Form , Select , Checkbox , Button , Spin , AutoComplete, Modal } from 'antd';
import { Base64 } from 'js-base64';
import { AlignCenter } from '../Component/layout';
import { withTranslation } from 'react-i18next';
import '../css/index.scss';
import './new.scss'
@ -380,6 +381,8 @@ class Index extends Component {
changeName=(e)=>{
let value = e.target.value;
const { t } = this.props;
console.log(this.props,t(value,'en'));
if(value){
let reg = /[a-zA-Z0-9]/g;
let strArr = value.match(reg);
@ -552,7 +555,7 @@ class Index extends Component {
required: true, message: '请填写项目名称'
}],
})(
<Input placeholder="例如:团队协作方法与研究" maxLength={50} />
<Input placeholder="例如:团队协作方法与研究" maxLength={50}/>// onBlur={this.changeName}
)}
</Form.Item>
</AlignCenter>
@ -760,6 +763,6 @@ class Index extends Component {
}
}
const WrappedIndexForm = Form.create({ name: 'NewWorkForm' })(Index);
export default WrappedIndexForm;
export default withTranslation()(WrappedIndexForm);

View File

@ -169,15 +169,15 @@ class UserSubmitComponent extends Component {
callback();
}
if (value) {
const str = '^*/';
const str = '^*';
let reg = /\\/g;
if(reg.test(value)){
callback(<span>分支名不能包含下列任何字符^*\/</span>);
callback(<span>分支名不能包含下列任何字符^*\</span>);
}else{
for(var i=0;i<str.length;i++){
let s = str[i];
if(value.indexOf(s) > -1){
callback(<span>分支名不能包含下列任何字符^*\/</span>);
callback(<span>分支名不能包含下列任何字符^*\</span>);
return;
}else{
continue;