fetch('http://10.58.52.230:3008/auth/signin', {
method: 'POST',
headers: { 'Content-Type': 'application/json;charset=utf-8' },
body: JSON.stringify({
email: isIdValue,
password: isPwValue,
}),
})
.then(response => {
console.log(response);
if (response.status != 200) {
throw new Error('error');
alert('로그인 실패');
}
return response.json();
})
.catch(err => {
console.log(err);
alert('로그인 실패');
})
.then(data => {
localStorage.setItem('token', data.accessToken);
return navMain('/MainPmy');
});