flat:合并冲突

This commit is contained in:
Apcallover
2025-12-03 11:08:53 +08:00
4 changed files with 15 additions and 4 deletions

View File

@@ -596,7 +596,16 @@ function getJobRecommend(type = 'add') {
if (question) {
comd.jobCategory = question;
data.unshift(comd);
// 生成随机插入位置,排除前两个和最后两个位置
let insertIndex;
if (data.length <= 4) {
// 如果数据长度小于等于4直接插入到中间位置
insertIndex = Math.floor(data.length / 2);
} else {
// 生成2到data.length-2之间的随机位置
insertIndex = Math.floor(Math.random() * (data.length - 4)) + 2;
}
data.splice(insertIndex, 0, comd);
}
}
const reslist = dataToImg(data);