2 回答
TA貢獻(xiàn)1811條經(jīng)驗(yàn) 獲得超6個(gè)贊
問題是這一行: $_SESSION['userID'] = $getUser['UserID']; The $getUserneeds to be $getNewUser,因?yàn)檫@是我從中獲取的變量的名稱。我一定是在不知不覺中改變了它,從而產(chǎn)生了問題。
TA貢獻(xiàn)1847條經(jīng)驗(yàn) 獲得超11個(gè)贊
我在這里可能錯(cuò)了,但我最好的猜測是您的 fetch api 收到錯(cuò)誤,您應(yīng)該嘗試將async onSignUp函數(shù)的 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)
});
您可以嘗試上述方法,看看您是否在響應(yīng)中收到錯(cuò)誤!希望這可以幫助!!
- 2 回答
- 0 關(guān)注
- 199 瀏覽
添加回答
舉報(bào)
