|
|
@@ -193,12 +193,12 @@ const addHistory = async (item) => {
|
|
|
try {
|
|
|
// 检查是否已存在相同路径
|
|
|
const index = historyList.value.findIndex(h => h.path === item.path);
|
|
|
-
|
|
|
- // 如果存在,先删除旧的
|
|
|
+
|
|
|
+ // 如果已存在,保持原有顺序,不做调整
|
|
|
if (index > -1) {
|
|
|
- historyList.value.splice(index, 1);
|
|
|
+ return;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 如果是工作台,确保它始终在第一位
|
|
|
if (item.path === '/ufo/home/workbench') {
|
|
|
historyList.value.unshift(item);
|