チキン食品プロジェクト8日目
1492 ワード
今日やったこと
うなずく
::aタグ発生ページリフレッシュ
:::linkラベルとaラベル、onclickイベントの違いは何ですか?
1)URLチェック
::
http://
:: :8000
submitUserInfo = e => {
// e.preventDefault();
fetch('http://10.58.1.207:8000/members/agreement', {
method: 'POST',
body: JSON.stringify(this.state.userInfo),
})
.then(response => response.json())
.then(result => console.log('결과: ', result));
};
ログイン成功時にトークンを受信しlocalStorageに保存するコードfetch('LOGIN_API', {
method: 'POST',
body: JSON.stringify({
email: this.state.email,
password: this.state.password,
})
})
.then(res => res.json())
.then(res => {
if (res.message === 'SUCCESS') {
localStorage.setItem('token', res.access_token);
this.props.history.push('/main');
} else {
alert('다시 입력해주세요!')
}
})
保存されたタグの使用方法fetch('UPDATE_CART_API', {
method: 'POST',
headers: {
Authorization: localStorage.getItem('token'),
}
body: JSON.stringify({
cartId: this.state.cartId,
})
})
.then()
.then()
Reference
この問題について(チキン食品プロジェクト8日目), 我々は、より多くの情報をここで見つけました https://velog.io/@taekjun_s/치킨푸드-프로젝트-8일차-frpnj39aテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol