mirror of
https://github.com/YMFE/yapi.git
synced 2025-01-30 13:20:24 +08:00
Merge branch 'dev' of gitlab.corp.qunar.com:mfe/yapi into dev
This commit is contained in:
commit
cb1a0dd0ba
@ -141,8 +141,9 @@ class UpDateModal extends Component {
|
||||
// can use data-binding to set
|
||||
form.setFieldsValue({
|
||||
envs: envs.filter(key => {
|
||||
const realKey = key._id ? key._id : key
|
||||
console.log(key);
|
||||
return key._id !== id;
|
||||
return realKey !== id;
|
||||
})
|
||||
});
|
||||
}
|
||||
@ -183,7 +184,7 @@ class UpDateModal extends Component {
|
||||
getFieldDecorator('envs', { initialValue: envMessage });
|
||||
const envs = getFieldValue('envs');
|
||||
const formItems = envs.map((k, index) => {
|
||||
// console.log(k);
|
||||
console.log(k);
|
||||
const secondIndex = 'next' + index; // 为保证key的唯一性
|
||||
return (
|
||||
<Row key={index} type="flex" justify="space-between" align={index === 0 ? 'middle' : 'top'}>
|
||||
@ -229,7 +230,7 @@ class UpDateModal extends Component {
|
||||
>
|
||||
{getFieldDecorator(`envs-domain-${index}`, {
|
||||
validateTrigger: ['onChange', 'onBlur'],
|
||||
initialValue: envMessage.length !== 0 ? k.domain.split('\/\/')[1] : '',
|
||||
initialValue: envMessage.length !== 0 && k.domain ? k.domain.split('\/\/')[1] : '',
|
||||
rules: [{
|
||||
required: false,
|
||||
whitespace: true,
|
||||
@ -269,7 +270,7 @@ class UpDateModal extends Component {
|
||||
<Icon
|
||||
className="dynamic-delete-button"
|
||||
type="minus-circle-o"
|
||||
onClick={() => this.remove(k._id)}
|
||||
onClick={() => this.remove(k._id ? k._id : k)}
|
||||
/>
|
||||
) : null}
|
||||
</Col>
|
||||
|
@ -26,7 +26,7 @@ class projectController extends baseController {
|
||||
|
||||
verifyDomain(domain){
|
||||
if(!domain) return false;
|
||||
if(/^[a-zA-Z0-9\-_\.]+[a-zA-Z]{2,6}$/.test(domain)){
|
||||
if(/^[a-zA-Z0-9\-_\.]+?\.[a-zA-Z0-9\-_\.]*?[a-zA-Z]{2,6}$/.test(domain)){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -332,7 +332,7 @@ class projectController extends baseController {
|
||||
|
||||
let projectData = await this.Model.get(id);
|
||||
|
||||
if(params.basepath = (this.handleBasepath(params.basepath)) === false){
|
||||
if((params.basepath = this.handleBasepath(params.basepath)) === false){
|
||||
return ctx.body = yapi.commons.resReturn(null, 401, 'basepath格式有误')
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ var projectController = function (_baseController) {
|
||||
key: 'verifyDomain',
|
||||
value: function verifyDomain(domain) {
|
||||
if (!domain) return false;
|
||||
if (/^[a-zA-Z0-9\-_\.]+[a-zA-Z]{2,6}$/.test(domain)) {
|
||||
if (/^[a-zA-Z0-9\-_\.]+?\.[a-zA-Z0-9\-_\.]*?[a-zA-Z]{2,6}$/.test(domain)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -778,7 +778,7 @@ var projectController = function (_baseController) {
|
||||
case 12:
|
||||
projectData = _context8.sent;
|
||||
|
||||
if (!(params.basepath = this.handleBasepath(params.basepath) === false)) {
|
||||
if (!((params.basepath = this.handleBasepath(params.basepath)) === false)) {
|
||||
_context8.next = 15;
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user