Commit 7c2aebdc authored by 周成波's avatar 周成波

bug

parent 1423d428
...@@ -378,10 +378,10 @@ const onAdaptOneSceneRoles = async (item: any) => { ...@@ -378,10 +378,10 @@ const onAdaptOneSceneRoles = async (item: any) => {
} }
if (!item.角色) { if (!item.角色) {
const role_history_arr = role_history.split(','); const role_history_arr = role_history.split(',');
if (role_history_arr.length >= 2) { const lastOne = role_history_arr[role_history_arr.length - 1];
item.角色 = role_history_arr[role_history_arr.length - 2]; const remainingValues = role_history_arr.filter(i => i !== lastOne);
} else if (role_history_arr.length == 1) { if (remainingValues.length >= 1) {
item.角色 = role_history_arr[role_history_arr.length - 1]; item.角色 = remainingValues[remainingValues.length - 1];
} else { } else {
item.角色 = item_roles.trim(); item.角色 = item_roles.trim();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment