添加文章评论功能
parent
f1078a4e15
commit
78cf379dd1
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
|
||||
namespace App\Controllers;
|
||||
use App\Models;
|
||||
use Core\Controller;
|
||||
use Core\View;
|
||||
use Parsedown;
|
||||
use App\Config;
|
||||
|
||||
|
||||
class DocComment extends Controller
|
||||
{
|
||||
public function insertAction(){
|
||||
$user = new Models\User();
|
||||
date_default_timezone_set("Asia/Shanghai");
|
||||
//var_dump($this->input);
|
||||
|
||||
$userdate = date("Y-m-d H:i:s",time());
|
||||
$this->input->created_date = $userdate;
|
||||
$this->input->update_date = $userdate;
|
||||
if( strlen($this->input->user_pwd ) < 6){
|
||||
$this->JsonResp(201,null,"password empty");
|
||||
return;
|
||||
}
|
||||
if(!$this->is_password($this->input->user_pwd)){
|
||||
$this->JsonResp(201,null,"password illegal");
|
||||
return;
|
||||
}
|
||||
$all = $user->InsertObject($this->input);
|
||||
$this->JsonResp(200,$all,"OK");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Core\Model;
|
||||
use PDO;
|
||||
|
||||
class DocComment extends Model
|
||||
{
|
||||
|
||||
}
|
Loading…
Reference in New Issue