Skip to content

Commit 6a31e01

Browse files
committed
feat: cos 支持前端直传
1 parent 9f70d1b commit 6a31e01

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

FileStorage/app/Utilities/CosUtility.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,13 @@ public static function getKeyAndCredentials(string $savePath)
124124
"action" => [
125125
"cos:PutObject",
126126
"cos:GetObject",
127+
128+
"cos:InitiateMultipartUpload",
129+
"cos:UploadPart",
130+
"cos:CompleteMultipartUpload",
131+
"cos:AbortMultipartUpload",
132+
"cos:ListMultipartUploads",
133+
"cos:ListParts",
127134
],
128135
"resource" => [
129136
"qcs::cos:$region:uid/<appid>:<bucket>-<appid>/$savePath",
@@ -136,7 +143,7 @@ public static function getKeyAndCredentials(string $savePath)
136143
]);
137144

138145
$token = \Overtrue\LaravelQcloudFederationToken\FederationToken::createToken();
139-
// $strategy = \Overtrue\LaravelQcloudFederationToken\FederationToken::strategy();
146+
$strategy = \Overtrue\LaravelQcloudFederationToken\FederationToken::strategy();
140147
$data = $token->toArray();
141148

142149
return array_merge($data, [
@@ -145,7 +152,7 @@ public static function getKeyAndCredentials(string $savePath)
145152
'bucket' => $bucket,
146153
'region' => $region,
147154
'key' => $savePath,
148-
// 'resources' => $strategy->getStatements()[0]['resource'] ?? [],
155+
'resources' => $strategy->getStatements(),
149156
]);
150157
}
151158
}

0 commit comments

Comments
 (0)