소스 검색

commit delete function

superbee 8 년 전
부모
커밋
1153a6f9c9
1개의 변경된 파일11개의 추가작업 그리고 0개의 파일을 삭제
  1. 11 0
      application/home/controller/User.php

+ 11 - 0
application/home/controller/User.php

@@ -76,4 +76,15 @@ class User extends Controller {
 		return json(['l'=>$info]);
 	}
 	
+	public function delete(){
+		$data = decode($this->request->post());
+		
+		$short = $data['s'];
+		
+		$path = "load/$short.txt";
+		$res = unlink($path);
+		
+		return json(['r'=>(($res)?1:0)]);
+	}
+	
 }