const createTerm = () => {
form
.validateFields()
.then((value) => {
console.log(value.aliases);
let api =
termInfo && Object.hasOwn(termInfo, "id")
? glossaryApi.updateGlossary({ ...value, id: termInfo?.id })
: glossaryApi.createGlossary({ ...value, domainId: 1000 });
api
.then((res) => {
setTermReturnId(res?.data);
message.success("术语创建成功");
})
.catch(() => {
message.error("术语创建失败");
});
})
};
console.log(value.aliases);打印结果是
['近似值 1', '近似值 2']
接口调用时,参数是
aliases: {0: "近似值 1", 1: "近似值 2"}
这就很奇怪
form
.validateFields()
.then((value) => {
console.log(value.aliases);
let api =
termInfo && Object.hasOwn(termInfo, "id")
? glossaryApi.updateGlossary({ ...value, id: termInfo?.id })
: glossaryApi.createGlossary({ ...value, domainId: 1000 });
api
.then((res) => {
setTermReturnId(res?.data);
message.success("术语创建成功");
})
.catch(() => {
message.error("术语创建失败");
});
})
};
console.log(value.aliases);打印结果是
['近似值 1', '近似值 2']
接口调用时,参数是
aliases: {0: "近似值 1", 1: "近似值 2"}
这就很奇怪