refactor: 优化getFileList函数,移除不必要的newObjectName变量
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user