解决已知问题
This commit is contained in:
@@ -89,7 +89,7 @@
|
||||
tr,
|
||||
th,
|
||||
td {
|
||||
@apply border p-[10px_20px];
|
||||
@apply border-[#eee] p-[10px_20px];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,8 @@ const PublishForm = ({ data, closeModel }: { data: Article, closeModel: () => vo
|
||||
const onSubmit: FormProps<FieldType>['onFinish'] = async (values) => {
|
||||
// 如果是文章标签,则先判断是否存在,如果不存在则添加
|
||||
let tagIds: number[] = []
|
||||
for (const item of (values.tagIds ? values.tagIds : [])) {
|
||||
if (values.tagIds) {
|
||||
for (const item of values.tagIds) {
|
||||
if (typeof item === "string") {
|
||||
// 如果已经有这个标签了,就没必要再创建一个了
|
||||
const tag1 = tagList.find(t => t.name === item)?.id;
|
||||
@@ -104,6 +105,7 @@ const PublishForm = ({ data, closeModel }: { data: Article, closeModel: () => vo
|
||||
tagIds.push(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
values.createTime = values.createTime.valueOf()
|
||||
values.cateIds = [...new Set(values.cateIds?.flat())]
|
||||
|
||||
Reference in New Issue
Block a user