We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ts 请求代码 function GetUser() { axios.post("/render/GetUser", { user: "111" }).then((res: any) => { console.log(res); }) }
function GetUser() { axios.post("/render/GetUser", { user: "111" }).then((res: any) => { console.log(res); }) }
PHP接收代码 public function action_GetUser(){ $user = $this->request->post("user"); $this->json([ "code"=>"00", "user"=>$user ]); }
public function action_GetUser(){ $user = $this->request->post("user"); $this->json([ "code"=>"00", "user"=>$user ]); }
请求返回 {"code":"00","user":null}
{"code":"00","user":null}
The text was updated successfully, but these errors were encountered:
看起来你这个并不是表单形式(x-www-form-urlencoded)的post参数格式,而是json格式的 可以尝试用 $this->request->json('user') 获取看看呢
$this->request->json('user')
Sorry, something went wrong.
恩,$this->request->json('user') 可以获取到了,谢谢
No branches or pull requests
ts 请求代码
function GetUser() { axios.post("/render/GetUser", { user: "111" }).then((res: any) => { console.log(res); }) }
PHP接收代码
public function action_GetUser(){ $user = $this->request->post("user"); $this->json([ "code"=>"00", "user"=>$user ]); }
请求返回
{"code":"00","user":null}
The text was updated successfully, but these errors were encountered: