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