|
|
@@ -34,4 +34,19 @@ class Aiexam extends HomeBaseController
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public function deleteFile()
|
|
|
+ {
|
|
|
+ $name = $this->request->param('name');
|
|
|
+ $filename = public_path('storage/files/ai_exam').$name;
|
|
|
+
|
|
|
+ if (file_exists($filename)) {
|
|
|
+ if (unlink($filename)) {
|
|
|
+ ajax_return(0, '删除成功');
|
|
|
+ } else {
|
|
|
+ ajax_return(1, '删除失败');
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ ajax_return(1, '文件不存在');
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|