2 回答

TA贡献1811条经验 获得超6个赞
问题是这一行: $_SESSION['userID'] = $getUser['UserID'];
The $getUser
needs to be $getNewUser
,因为这是我从中获取的变量的名称。我一定是在不知不觉中改变了它,从而产生了问题。

TA贡献1847条经验 获得超11个赞
我在这里可能错了,但我最好的猜测是您的 fetch api 收到错误,您应该尝试将async onSignUp函数的 fetch 修改为:
await fetch(SIGNUP_URL, {<params>})
.then(res => {
// Handle API Errors
if (!res.ok) {
console.log(res.statusText);
}
// Return if no errors
return res.json();
})
// this is the data you want
.then(data => data)
// it will only reject on network failure or if anything prevented the request from completing
.catch(error => {
console.log(error.message)
});
您可以尝试上述方法,看看您是否在响应中收到错误!希望这可以帮助!!
- 2 回答
- 0 关注
- 193 浏览
添加回答
举报