使用 axios 发送POST 请求时,无法正常接收到数据
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 1.7k
- Forks
- 253
- PR merge metrics
- No merged PRs in 30d
Description
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}




Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the action_GetUser entry point and reproduce the TypeScript axios POST request shown in the issue. Inspect how the PHP request reads the posted user value and compare the received request with the response; done means the response contains user="111" instead of null.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, typescript
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100