feat:修改七牛云上传下载路径读取 qiniudomain文件夹下的子文件夹名称

This commit is contained in:
joywayer
2026-02-11 20:59:20 +08:00
parent 7ee8413a3e
commit 09353155ec
7 changed files with 57 additions and 7 deletions

View File

@@ -1269,11 +1269,22 @@ FuncPublic * _funcPublic = nil;
+(NSString *)filename:(NSString *)file
{
NSString *path=[FuncPublic getFilePath:file PathType:3];//
// NSLog(@"[FuncPublic filename] reading path: %@", path);
NSFileManager* fm=[NSFileManager defaultManager];
if([fm fileExistsAtPath:path]){
NSArray *files = [fm subpathsAtPath: path ];
NSLog(@"%@",[files objectAtIndex:0]);
return [files objectAtIndex:0];
NSArray *files = [fm subpathsAtPath: path];
// NSLog(@"[FuncPublic filename] files found in %@: %@", file, files);
for (NSString *name in files) {
// .DS_Store
if (![name hasPrefix:@"."] && ![name isEqualToString:@".DS_Store"]) {
// NSLog(@"[FuncPublic filename] filename found: %@", name);
return name;
}
}
} else {
// NSLog(@"[FuncPublic filename] Path does not exist: %@", path);
}
return @"";
}