oss
parent
3d1c2faf2a
commit
7131b662d0
|
|
@ -110,7 +110,7 @@ class OssCopy extends Command
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (count($data) > 0) {
|
if (count($data) > 0) {
|
||||||
$model->forceFill($data)->save();
|
// $model->forceFill($data)->save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -124,12 +124,15 @@ class OssCopy extends Command
|
||||||
|
|
||||||
$newUrl = 'https://jiqu-libs.oss-cn-chengdu.aliyuncs.com/';
|
$newUrl = 'https://jiqu-libs.oss-cn-chengdu.aliyuncs.com/';
|
||||||
$bucket = 'jiqu-libs';
|
$bucket = 'jiqu-libs';
|
||||||
if (Str::startsWith($url, $baseUrl)) {
|
if (!Str::startsWith($url, $newUrl)) {
|
||||||
$path = substr($url, strlen($baseUrl));
|
throw new OssException('1');
|
||||||
$client->copyObject($oldBucket, $path, $bucket, $path);
|
|
||||||
|
|
||||||
return $newUrl . $path;
|
|
||||||
}
|
}
|
||||||
|
// if (Str::startsWith($url, $baseUrl)) {
|
||||||
|
// $path = substr($url, strlen($baseUrl));
|
||||||
|
// $client->copyObject($oldBucket, $path, $bucket, $path);
|
||||||
|
|
||||||
|
// return $newUrl . $path;
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
return $url;
|
return $url;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue