mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-21 05:19:42 +08:00
fix: 修改project/add&up接口参数
This commit is contained in:
parent
7d3e86bf97
commit
45a3776f28
@ -37,10 +37,11 @@ const changeTableLoading = (data) => {
|
||||
};
|
||||
|
||||
const addProject = (data) => {
|
||||
const { name, prd_host, basepath, desc, group_id } = data;
|
||||
const { name, prd_host, basepath, desc, group_id, protocol } = data;
|
||||
const param = {
|
||||
name,
|
||||
prd_host,
|
||||
protocol,
|
||||
basepath,
|
||||
desc,
|
||||
group_id
|
||||
@ -53,10 +54,11 @@ const addProject = (data) => {
|
||||
};
|
||||
|
||||
const updateProject = (data) => {
|
||||
const { name, prd_host, basepath, desc, _id } = data;
|
||||
const { name, prd_host, basepath, desc, _id, protocol } = data;
|
||||
const param = {
|
||||
name,
|
||||
prd_host,
|
||||
protocol,
|
||||
basepath,
|
||||
desc,
|
||||
id: _id
|
||||
|
@ -27,7 +27,7 @@ const deleteConfirm = (id, handleDelete, currGroupId, handleFetchList) => {
|
||||
}
|
||||
return test;
|
||||
};
|
||||
// this.props.fetchProjectList, this.props.changeUpdateModal
|
||||
|
||||
const getColumns = (data, props) => {
|
||||
const { handleDelete, currGroup, fetchProjectList, changeUpdateModal, userInfo } = props;
|
||||
return [{
|
||||
@ -130,7 +130,7 @@ class ProjectList extends Component {
|
||||
});
|
||||
}
|
||||
|
||||
// 确认修改
|
||||
// 确认添加项目
|
||||
@autobind
|
||||
handleOk(e) {
|
||||
const { form, currGroup, changeTableLoading, addProject, fetchProjectList } = this.props;
|
||||
@ -138,7 +138,7 @@ class ProjectList extends Component {
|
||||
e.preventDefault();
|
||||
form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
values.prd_host = this.state.protocol + values.prd_host;
|
||||
values.protocol = this.state.protocol.split(':')[0];
|
||||
// 获取当前分组id传入values
|
||||
values.group_id = currGroup._id;
|
||||
|
||||
|
@ -86,7 +86,7 @@ class UpDateModal extends Component {
|
||||
if (!err) {
|
||||
console.log(projectList[handleUpdateIndex]);
|
||||
let assignValue = Object.assign(projectList[handleUpdateIndex], values);
|
||||
assignValue.prd_host = this.state.protocol + assignValue.prd_host;
|
||||
values.protocol = this.state.protocol.split(':')[0];
|
||||
assignValue.env = assignValue.envs.map((item) => {
|
||||
console.log(assignValue);
|
||||
const arr = assignValue['envs-'+item].split(',');
|
||||
|
Loading…
Reference in New Issue
Block a user