From 4fc59403ffae53ead6a3ddaacaaefd4b452579dc Mon Sep 17 00:00:00 2001 From: choseoin Date: Thu, 12 Aug 2021 15:36:12 +0900 Subject: [PATCH] =?UTF-8?q?[feat]=20=ED=9A=8C=EC=9B=90=EA=B0=80=EC=9E=85?= =?UTF-8?q?=20-=20=EC=A0=84=ED=99=94=EB=B2=88=ED=98=B8=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80,=20=EC=95=84=EC=9D=B4=EB=94=94=20=EC=A4=91=EB=B3=B5?= =?UTF-8?q?=20=EC=B2=B4=ED=81=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/component/SignUp.js | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/src/component/SignUp.js b/src/component/SignUp.js index 977881e..5e84662 100644 --- a/src/component/SignUp.js +++ b/src/component/SignUp.js @@ -5,23 +5,30 @@ import { useState } from 'react'; import Axios from 'axios'; function SignUp() { - const [name, setName] = useState(''); const [id, setId] = useState(''); const [pw, setPw] = useState(''); + const [tel, setTel] = useState(''); const [email, setEmail] = useState(''); const [major, setMajor] = useState(''); const submitSignUp = () => { Axios.post('join', { - name: name, id: id, pw: pw, email: email, - major: major + major: major, + name: name, + tel: tel, }).then(res => { - console.log(res); - alert(res.data) + if(res.data.success) { + console.log(res.data); + alert(res.data.message); + window.location.href="/auth/login"; + } + else { + alert(res.data.message); + } }); }; @@ -53,7 +60,13 @@ function SignUp() { setPw(e.target.value); }}/> - + +
+ { + setTel(e.target.value); + }}/> + +
{ setEmail(e.target.value); @@ -66,9 +79,9 @@ function SignUp() { }}/>
- - - + {/* */} + + {/* */}