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