2023-12-26 09:05:40 +00:00
|
|
|
import Form from "react-bootstrap/Form";
|
|
|
|
|
import Row from "react-bootstrap/Row";
|
|
|
|
|
import Col from "react-bootstrap/Col";
|
|
|
|
|
import Button from "react-bootstrap/Button";
|
2023-12-28 07:24:22 +00:00
|
|
|
import * as EgovNet from "../../api/egovFetch";
|
2023-12-26 09:05:40 +00:00
|
|
|
|
|
|
|
|
function PwFindForm(){
|
2023-12-28 07:24:22 +00:00
|
|
|
|
|
|
|
|
const findPw = (e) => {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
const form = e.currentTarget;
|
|
|
|
|
if(!form.email.value){
|
|
|
|
|
alert("이메일을 입력해주세요.")
|
|
|
|
|
}if(!form.id.value){
|
|
|
|
|
alert("아이디를 입력해주세요.")
|
|
|
|
|
}else{
|
|
|
|
|
EgovNet.requestFetch(
|
|
|
|
|
"/auth/findPw",
|
|
|
|
|
{
|
|
|
|
|
method: "POST",
|
|
|
|
|
headers: {
|
|
|
|
|
'Content-type': 'application/json'
|
|
|
|
|
},
|
|
|
|
|
body: JSON.stringify({email: form.email.value, id: form.id.value})
|
|
|
|
|
},
|
|
|
|
|
(resp) => {
|
|
|
|
|
document.querySelector("#findResultLabel").innerText = resp.resultMessage;
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-26 09:05:40 +00:00
|
|
|
return (
|
2023-12-28 07:24:22 +00:00
|
|
|
<Form onSubmit={findPw} noValidate>
|
2023-12-26 09:05:40 +00:00
|
|
|
<Form.Group as={Row} className="mb-3" controlId="formHorizontalEmail">
|
|
|
|
|
<Form.Label column sm={2}>
|
|
|
|
|
아이디
|
|
|
|
|
</Form.Label>
|
|
|
|
|
<Col sm={10}>
|
2023-12-28 07:24:22 +00:00
|
|
|
<Form.Control type="text" name="id" placeholder="ID" required />
|
2023-12-26 09:05:40 +00:00
|
|
|
</Col>
|
|
|
|
|
</Form.Group>
|
|
|
|
|
<Form.Group as={Row} className="mb-3" controlId="formHorizontalEmail">
|
|
|
|
|
<Form.Label column sm={2}>
|
|
|
|
|
이메일
|
|
|
|
|
</Form.Label>
|
|
|
|
|
<Col sm={10}>
|
2023-12-28 07:24:22 +00:00
|
|
|
<Form.Control type="email" name="email" placeholder="Email" required/>
|
2023-12-26 09:05:40 +00:00
|
|
|
</Col>
|
|
|
|
|
</Form.Group>
|
2023-12-28 07:24:22 +00:00
|
|
|
<Row className="mb-3">
|
|
|
|
|
<Form.Label column xs={{span:8, offset:2}} id="findResultLabel"></Form.Label>
|
|
|
|
|
<Col xs={2}>
|
|
|
|
|
<Button type="submit">찾기</Button>
|
2023-12-26 09:05:40 +00:00
|
|
|
</Col>
|
2023-12-28 07:24:22 +00:00
|
|
|
</Row>
|
2023-12-26 09:05:40 +00:00
|
|
|
</Form>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default PwFindForm;
|