로그인 버튼 추가
This commit is contained in:
@@ -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>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
BIN
src/assets/kakao_login_medium_narrow.png
Normal file
BIN
src/assets/kakao_login_medium_narrow.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
Reference in New Issue
Block a user