1
This commit is contained in:
1 parent
4d5d7dd456
commit
9788861224
1 file changed
+6
-8
@@ -31,6 +31,7 @@ def down_obj_fromoss(pid,order_id):
|
||||
if res.json()['code'] == 1000:
|
||||
ossPath = res.json()['data']
|
||||
ossPath = ossPath.replace("\\","/")
|
||||
|
||||
|
||||
path = os.path.join(workdir, 'print', pid)
|
||||
if not os.path.exists(path): os.makedirs(path)
|
||||
@@ -39,17 +40,14 @@ def down_obj_fromoss(pid,order_id):
|
||||
prefix = f'objs/print/{pid}/'
|
||||
if ossPath != "":
|
||||
prefix = os.path.join("objs","print",pid,ossPath,order_id)
|
||||
prefix = prefix.replace("\\","/")
|
||||
|
||||
print(f'prefix:{prefix}')
|
||||
print(f'ossPath:{ossPath}')
|
||||
# #判断filelist是否为空
|
||||
# if len(list(filelist)) == 0:
|
||||
# filelist = oss2.ObjectIteratorV2(oss_client, prefix=f'objs/print/{pid}/')
|
||||
# print(f"从 objs/print/{pid}/ 下载数据")
|
||||
# else:
|
||||
print(f"从 objs/print/{pid}/{ossPath}/{order_id}/ 下载数据")
|
||||
prefix = "objs/print/253312/model/standard_size/88942"
|
||||
print(f'实际有用的地址:objs/print/253312/model/standard_size/88942')
|
||||
filelist = oss2.ObjectIteratorV2(oss_client, prefix=prefix)
|
||||
if len(list(filelist)) == 0:
|
||||
filelist = oss2.ObjectIteratorV2(oss_client, prefix=f"objs/print/{pid}")
|
||||
|
||||
find = False
|
||||
for file in filelist:
|
||||
filename = file.key.split('/')[-1]
|
||||
|
||||
Reference in new issue
Block a user