我用request()->isAjax()这个条件一直获取不到数据,不知道是否正确,各位大神帮我看看,谢谢啦~
代码如下:
<?php
namespace app\index\controller;
use think\Controller;
use think\Db;
use think\Request;
class User extends Controller{
//新增用户
public function add_user(){
if (request()->isAjax()){
$data = input('post.');
p($data);die;
}else{
return $this -> fetch();
}
} 最佳答案