refactor: 优化getFileList函数,移除不必要的newObjectName变量

This commit is contained in:
2026-03-03 02:48:05 +08:00
parent a48cc48589
commit 75ab160509

View File

@@ -27,12 +27,10 @@ type FileList = {
export const getFileList = async (list: any, opts?: { objectName: string; app: string; host?: string }) => {
const { app, host } = opts || {};
const objectName = opts?.objectName || '';
let newObjectName = objectName;
const [user] = objectName.split('/');
let replaceUser = user + '/';
if (app === 'resources') {
replaceUser = `${user}/resources/`;
newObjectName = objectName.replace(`${user}/`, replaceUser);
}
return list.map((item: FileList) => {
if (item.name) {