lang 4 жил өмнө
parent
commit
566fbd90e8

+ 4 - 4
Controller/CloudStorage.py

@@ -342,7 +342,7 @@ class CloudStorageView(View):
                         res = json.loads(sts_qs[0]["data"])
                         return JsonResponse(status=200, data=res)
                     # 套餐id
-                storage = '{uid}/vod{channel}/'.format(uid=uid, channel=channel)
+                # storage = '{uid}/vod{channel}/'.format(uid=uid, channel=channel)
                 bucket_name = ubqs[0]['bucket__bucket']
                 endpoint = ubqs[0]['bucket__endpoint']
                 region_id = ubqs[0]['bucket__region']
@@ -363,8 +363,8 @@ class CloudStorageView(View):
                         {
                             "Effect": "Allow",
                             "Action": "s3:*",
-                            "Resource": ["arn:aws:s3:::{bucket_name}/{uid_channel}/*".
-                                             format(bucket_name=bucket_name,uid_channel=storage)]
+                            "Resource": ["arn:aws:s3:::{bucket_name}/{uid}/*".
+                                             format(bucket_name=bucket_name,uid=uid)]
                         }
                     ]
                 }
@@ -385,7 +385,7 @@ class CloudStorageView(View):
                     'bucket_name': bucket_name,
                     'arn': response['FederatedUser']['Arn'],
                     'code': 0,
-                    'storage': storage,
+                    'storage': uid,
                     'endTime': ubqs[0]['endTime'],
                     'ip': ip,
                 }

+ 1 - 1
Controller/TestApi.py

@@ -701,7 +701,7 @@ class testView(View):
         client = session.client("s3")
         bucket = "asj-oct-ipc" # 【你 bucket 的名字】 # 首先需要保.证 s3 上已经存在该存储桶,否则报错
         upload_data = open("./././static/log/error.log", "rb")
-        upload_key = "86YC8Z192VB1VMKU111A/vod1/test"
+        upload_key = "86YC8Z192VB1VMKU111A/test"
         file_obj = s3.Bucket(bucket).put_object(Key=upload_key, Body=upload_data)
         print('--------')
         print(file_obj)