로그인 버튼 추가

This commit is contained in:
root
2025-07-22 18:34:42 +09:00
parent 48744c4774
commit 7eccb5f1c7
2 changed files with 7 additions and 14 deletions

View File

@@ -2,6 +2,8 @@
import axios from "axios";
import { useState } from "react";
import loginButton from '@/assets/kakao_login_medium_narrow.png';
const LoginForm = () => {
const [id, setId] = useState('') //ID
@@ -13,29 +15,20 @@ const LoginForm = () => {
const requestUrl = 'http://localhost:8080/login/oauth-kakao'
const login = () => {
setParams({id, pw})
console.log(id, pw)
axios.post(requestUrl, params).then((res) => {
axios.post(requestUrl).then((res) => {
console.log(requestUrl + "===>")
console.log(res.data)
}).catch((e) => {
console.log('errorMsg' + "===>")
console.log(e)
})
}
return (
<>
<input type="text"
placeholder="ID"
value={id}
onChange={(e) => {setId(e.target.value)}}/>
<input type="password"
placeholder="PW"
value={pw}
onChange={(e) => {setPw(e.target.value)}}/>
<button type="button" onClick={login}></button>
<button type="button" onClick={login}>
<img src={loginButton.src} alt="카카오톡 로그인"/>
</button>
</>
)
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB