<input type="hidden" id="token" value="{$Request.token}" /> var token = $("#token").val(); $.ajax({ type: "post", dataType: "json", url: "/publesetPass", data: { 'unme': usrName, "newpss": newPass, "__token__": token }, success: function (ret) { console.log(ret); }, });php代码:
$rule=[
'unme'=>'require',
'__token__' => 'token'
];
$data=[
'unme'=>$datas['unme']
];
$vali=new Validate($rule);
$res=$vali->check($data);
if(!$res){
$resmsg=$vali->getError();
return json(['code'=>1001,'data'=>'','msg'=>$resmsg]);
}
下一篇:tp5 支付宝电脑网页支付接口