|
@@ -73,7 +73,7 @@ class OssService extends Service
|
|
|
}
|
|
|
|
|
|
//生成临时文件
|
|
|
- public function getTemporaryUrl($objectKey)
|
|
|
+ public function getTemporaryUrl($objectKey, $expired = 3500)
|
|
|
{
|
|
|
$timeStamp = time();
|
|
|
|
|
@@ -90,11 +90,12 @@ class OssService extends Service
|
|
|
}
|
|
|
|
|
|
$url = "";
|
|
|
+ $timestamp = $timeStamp + $expired;
|
|
|
if(! file_exists($localFilePath)){
|
|
|
- $url = $this->createUrl($objectKey);
|
|
|
+ $url = $this->createUrl($objectKey, $expired);
|
|
|
$set = [
|
|
|
'url' => $url,
|
|
|
- 'timestamp' => $timeStamp + 3500,
|
|
|
+ 'timestamp' => $timestamp,
|
|
|
];
|
|
|
file_put_contents($localFilePath, json_encode($set));
|
|
|
}else{
|