| xqd
@@ -2,6 +2,7 @@
|
|
|
|
|
|
use Illuminate\Support\Arr;
|
|
|
use \Illuminate\Support\Facades\DB;
|
|
|
+use Illuminate\Support\Facades\Storage;
|
|
|
|
|
|
|
|
|
if (! function_exists('user_admin_config')) {
|
| xqd
@@ -186,3 +187,13 @@ function get_vip_config($key){
|
|
|
return \App\Models\VipConfig::query()->where('id',2)->value($key);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+function del_file($filename){
|
|
|
+ $oss_config = config("filesystems.disks.oss");
|
|
|
+ $head = "https://".$oss_config['bucket'].'.'.$oss_config['endpoint'].'/';
|
|
|
+ $disk = Storage::disk('oss');
|
|
|
+ $url = str_replace($head,"",$filename);
|
|
|
+ if($disk->exists($url)){
|
|
|
+ $disk->delete($url);
|
|
|
+ }
|
|
|
+}
|