刘远航 4 سال پیش
والد
کامیت
1905175208
1فایلهای تغییر یافته به همراه17 افزوده شده و 0 حذف شده
  1. 17 0
      app/Http/Controllers/Api/V2/CommonController.php

+ 17 - 0
app/Http/Controllers/Api/V2/CommonController.php

xqd xqd
@@ -1049,6 +1049,7 @@ class CommonController extends Controller
      *
      */
     public function SecretReport(){
+
         $req = request()->post();
         $callids = CallLog::where('call_id',$req[0]['call_id'])->first();
         try {
@@ -1134,6 +1135,22 @@ class CommonController extends Controller
         }catch (\PDOException $e){
             ImMessage::create(['text'=>json_encode($e->getFile().'的第 '.$e->getLine().'行报错:'.$e->getMessage(),true)]);
         }
+    }
+
+    /**
+     * 删除图片
+     * @return \Illuminate\Http\JsonResponse
+     * @throws \Illuminate\Validation\ValidationException
+     */
+    public function delFile(){
+        $req = request()->post();
+        $this->validate(request(), [
+            'url' => 'required|url'
+        ]);
+        $tem = parse_url($req['url']);
+        $allPath = public_path().$tem['path'];
+        unlink($allPath);
+        return out();
 
     }
 }