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 關注
- 179 瀏覽
添加回答
舉報