update
This commit is contained in:
@@ -2,8 +2,7 @@ import router from "../router/index.js";
|
||||
|
||||
export const toPath = (path, query = {}) => {
|
||||
router.push({
|
||||
path: path,
|
||||
query: query
|
||||
path: path, query: query
|
||||
}).then();
|
||||
}
|
||||
|
||||
@@ -40,3 +39,19 @@ export const determineMediaType = (url) => {
|
||||
return 'Unknown';
|
||||
}
|
||||
}
|
||||
|
||||
export const findSwappedIds = (original, swapped) => {
|
||||
let id1, id2;
|
||||
|
||||
original.forEach((item, index) => {
|
||||
if (item.id !== swapped[index].id) {
|
||||
if (!id1) {
|
||||
id1 = item.id; // 记录第一个不同的 id
|
||||
} else {
|
||||
id2 = item.id; // 记录第二个不同的 id
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return [id1, id2];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user