lastEditTime 字段名调整;修改algolia逻辑

This commit is contained in:
tangly1024
2023-07-29 16:38:49 +08:00
parent c13eb5e65e
commit 7841b556d6
39 changed files with 148 additions and 80 deletions

View File

@@ -117,7 +117,13 @@ export function deepClone(obj) {
if (obj && typeof obj === 'object') {
for (const key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
newObj[key] = (obj && typeof obj[key] === 'object') ? deepClone(obj[key]) : obj[key]
if (obj[key] instanceof Date) { // 判断属性值是否为 Date 对象
newObj[key] = new Date(obj[key].getTime()).toISOString() // 直接拷贝引用
} else if (obj[key] && typeof obj[key] === 'object') {
newObj[key] = deepClone(obj[key])
} else {
newObj[key] = obj[key]
}
}
}
}