解决已知问题

This commit is contained in:
Liu 宇阳
2024-11-06 20:15:01 +08:00
parent 0901a43396
commit c273933ede
2 changed files with 18 additions and 16 deletions

View File

@@ -89,7 +89,7 @@
tr,
th,
td {
@apply border p-[10px_20px];
@apply border-[#eee] p-[10px_20px];
}
}

View File

@@ -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())]