Commit 40581228 authored by Spark's avatar Spark
Browse files

0721 commit

parent 07a9f48d
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#DB #DB
src/db src/db
src/data
npm-debug.log* npm-debug.log*
yarn-debug.log* yarn-debug.log*
......
...@@ -39,3 +39,20 @@ export function isOauth(value) { ...@@ -39,3 +39,20 @@ export function isOauth(value) {
const TFoauth = value const TFoauth = value
return TFoauth; return TFoauth;
} }
// export async function doeCode() {
// const response = await axios.get('http://175.125.254.72:8090/api/data/loccode')
// // console.log('res::', response.data.locCodes)
// const resData = response.data.locCodes
// const doe = resData.DOE
// // console.log('dd', doe) //object
// // console.log('dd::', doe[doe.length-1])
// // console.log('values::', Object.values(doe))
// const doeValue = Object.values(doe)
// // console.log('@@@11', doeValue[0]['code_doe'], typeof(doeValue[0]['code_doe']))
// // console.log('@@@22', doeValue[0]['name_doe'], typeof(doeValue[0]['name_doe']))
// return doeValue
// }
\ No newline at end of file
...@@ -16,8 +16,6 @@ export function LoginWithKakao() { ...@@ -16,8 +16,6 @@ export function LoginWithKakao() {
console.log(JSON.stringify(authObj)) console.log(JSON.stringify(authObj))
console.log('accT ;;', authObj.access_token) console.log('accT ;;', authObj.access_token)
console.log(typeof (localStorage))
console.log(Object.keys(localStorage)[0])
Kakao.API.request({ Kakao.API.request({
// 현재 로그인한 사용자의 카카오계정 정보 불러오기 // 현재 로그인한 사용자의 카카오계정 정보 불러오기
......
...@@ -2,6 +2,8 @@ import React from 'react' ...@@ -2,6 +2,8 @@ import React from 'react'
import '../App.css' import '../App.css'
import { Form, Button, Row, Col, Card, DropdownButton, Dropdown, ButtonGroup } from 'react-bootstrap'; import { Form, Button, Row, Col, Card, DropdownButton, Dropdown, ButtonGroup } from 'react-bootstrap';
import { useState } from 'react'; import { useState } from 'react';
import axios from 'axios';
// import { doeCode } from '../utils/Auth';
function LocCodeChange() { function LocCodeChange() {
...@@ -45,14 +47,40 @@ function LocCodeChange() { ...@@ -45,14 +47,40 @@ function LocCodeChange() {
auth.style.visibility = 'visible' auth.style.visibility = 'visible'
} }
// console.log(typeof (locCode()))
// console.log(locCode())
// const [ddoe, setDdoe] = useState([])
// async function DoeCode() {
// await doeCode().then((res) => {
// // // // for (let i = 0; i < res.length; i++) {
// // // console.log(res[0]['code_doe'])
// // // console.log(0, res[0]['name_doe'])
// ddoe.push(res[0]['name_doe'])
// ddoe.push(res[1]['name_doe'])
// console.log(ddoe)
// console.log(typeof(ddoe))
// // // }
// })
// }
const res = axios.get("localhost:4500/d/loccode");
// const does = res.data["locCodes"]["DOE"] // object
return ( return (
<Row className='text-center w-100 my-2'> <Row className='text-center w-100 my-2'>
{/* {DoeCode()} */}
{/* {data} */}
asd
<Card style={cardstyled}> <Card style={cardstyled}>
<Card.Title id='impactTitle'> <Card.Title id='impactTitle'>
Local Code Local Code
</Card.Title> </Card.Title>
<Card.Subtitle style={{ fontWeight: 'lighter' }}> <Card.Subtitle style={{ fontWeight: 'lighter' }}>
Please select a region name Please select a your region
</Card.Subtitle> </Card.Subtitle>
<hr /> <hr />
<Card.Text> <Card.Text>
...@@ -66,11 +94,10 @@ function LocCodeChange() { ...@@ -66,11 +94,10 @@ function LocCodeChange() {
title='지역코드' title='지역코드'
as={ButtonGroup} as={ButtonGroup}
title={` ${localname} `}> title={` ${localname} `}>
<Dropdown.Item>Action</Dropdown.Item>
<Dropdown.Item></Dropdown.Item>
<Dropdown.Item>Another action</Dropdown.Item> <Dropdown.Item>Another action</Dropdown.Item>
<Dropdown.Item>Something else here</Dropdown.Item> <Dropdown.Item>Something else here</Dropdown.Item>
<Dropdown.Divider />
<Dropdown.Item>Separated link</Dropdown.Item>
</DropdownButton> </DropdownButton>
))} ))}
<Button variant='light' style={btnstyled2} onClick={!locCodeShow && handleClickLoc}>확인</Button> <Button variant='light' style={btnstyled2} onClick={!locCodeShow && handleClickLoc}>확인</Button>
......
import React from 'react' import React, { useState } from 'react';
import '../App.css' import '../App.css'
import { Form, Button, Row, Col, Card } from 'react-bootstrap'; import { Form, Button, Row, Col, Card, Alert } from 'react-bootstrap';
import { LoginWithKakao } from '../utils/Oauth'; import { LoginWithKakao } from '../utils/Oauth';
function LoginComp() { function LoginComp() {
...@@ -26,6 +26,12 @@ function LoginComp() { ...@@ -26,6 +26,12 @@ function LoginComp() {
padding: '10px' padding: '10px'
} }
const [emailSent, setEmailSent] = useState(false)
const [alertShow, setAlertShow] = useState(true)
function CheckEmailSend() {
setEmailSent(!emailSent)
}
return ( return (
<Row className='text-center w-100 my-2'> <Row className='text-center w-100 my-2'>
...@@ -38,12 +44,32 @@ function LoginComp() { ...@@ -38,12 +44,32 @@ function LoginComp() {
</Card.Subtitle> </Card.Subtitle>
<hr /> <hr />
<Card.Text> <Card.Text>
<Row className='m-auto d-flex justify-content-center' style={{ width: '80%' }}>
{!emailSent ?
<Alert show={alertShow} variant={'success'}>
<Col>
😍 이메일 전송이 완료 되었습니다.
</Col>
<Alert.Link href='/' style={{ fontSize: '0.8em' }}>
이메일 확인 하러가기
</Alert.Link>
</Alert>
:
<Alert show={alertShow} variant={'danger'}>
<Col>
😭 이메일을 정확하게 적어주세요.
</Col>
</Alert>
}
<Button onClick={() => setAlertShow(true)}>보여주고</Button>
<Button onClick={() => setAlertShow(false)}>안보여주고</Button>
</Row>
<Form style={inboxstyled}> <Form style={inboxstyled}>
<Form.Group controlId="formBasicEmail"> <Form.Group controlId="formBasicEmail">
<Form.Control type="email" placeholder="Email" /> <Form.Control type="email" placeholder="Email" />
</Form.Group> </Form.Group>
<Button variant='light' type="submit" id='formbtn'> <Button variant='light' type="submit" id='formbtn' onClick={CheckEmailSend}>
LOGIN LOGIN
</Button> </Button>
......
import React, { useState } from 'react' import React, { useState } from 'react'
import '../App.css' import '../App.css'
import { Form, Button, Row, Col, Card } from 'react-bootstrap'; import { Form, Button, Row, Col, Card, Alert } from 'react-bootstrap';
import { LoginWithKakao } from '../utils/Oauth'; import { LoginWithKakao } from '../utils/Oauth';
function SignupComp() { function SignupComp() {
...@@ -17,7 +17,6 @@ function SignupComp() { ...@@ -17,7 +17,6 @@ function SignupComp() {
color: '#04AB70' color: '#04AB70'
} }
const inboxstyled = { const inboxstyled = {
display: 'flex', display: 'flex',
flexDirection: 'column', flexDirection: 'column',
...@@ -67,7 +66,12 @@ function SignupComp() { ...@@ -67,7 +66,12 @@ function SignupComp() {
} }
// console.log(emailSubm); const [userExist, setUserExist] = useState(false)
const [alertShow, setAlertShow] = useState(true)
function CheckUserExist() {
setUserExist(!userExist)
}
return ( return (
...@@ -82,6 +86,30 @@ function SignupComp() { ...@@ -82,6 +86,30 @@ function SignupComp() {
</Card.Subtitle> </Card.Subtitle>
<hr /> <hr />
<Card.Text> <Card.Text>
<Row className='m-auto d-flex justify-content-center' style={{ width: '80%' }}>
{!userExist ?
<Alert show={alertShow} variant={'success'}>
<Col>
😊 계정 생성이 완료 되었습니다.
</Col>
<Alert.Link href='/login' style={{ fontSize: '0.8em' }}>
로그인 하러가기
</Alert.Link>
</Alert>
:
<Alert show={alertShow} variant={'danger'}>
<Col>
🤔 이미 존재하는 계정입니다.
</Col>
<Alert.Link href='/login' style={{ fontSize: '0.8em' }}>
로그인 하러가기
</Alert.Link>
</Alert>
}
<Button onClick={() => setAlertShow(true)}>보여주고</Button>
<Button onClick={() => setAlertShow(false)}>안보여주고</Button>
</Row>
<Form style={inboxstyled} <Form style={inboxstyled}
onSubmit={handleSubmit}> onSubmit={handleSubmit}>
<Form.Group controlId="userEmail"> <Form.Group controlId="userEmail">
...@@ -92,7 +120,6 @@ function SignupComp() { ...@@ -92,7 +120,6 @@ function SignupComp() {
placeholder="Name" placeholder="Name"
value={formValues.name} value={formValues.name}
onChange={handleChange} onChange={handleChange}
// readOnly={emailSubm}
required required
/> />
</Row> </Row>
...@@ -106,49 +133,12 @@ function SignupComp() { ...@@ -106,49 +133,12 @@ function SignupComp() {
placeholder="Email Address" placeholder="Email Address"
value={formValues.email} value={formValues.email}
onChange={handleChange} onChange={handleChange}
readOnly={emailSubm}
required required
/> />
</Row> </Row>
</Form.Group> </Form.Group>
<Button variant='light' className='mt-2' type="submit" id='formbtn' onClick={CheckUserExist}>
{/*
<Row className='m-auto w-100 d-flex justify-content-center'>
<Col md={12} xs={12} style={{ padding: '0', display: 'flex', justifyContent: 'center', width: '100%' }}>
{['도', '시군구', '읍면동'].map((localname) => (
<DropdownButton
variant='light'
style={btnstyled2}
title='지역코드'
as={ButtonGroup}
title={` ${localname} `}
>
<Dropdown.Item>Action</Dropdown.Item>
<Dropdown.Item>Another action</Dropdown.Item>
<Dropdown.Item>Something else here</Dropdown.Item>
<Dropdown.Divider />
<Dropdown.Item>Separated link</Dropdown.Item>
</DropdownButton>
))}
<Button variant='light' style={btnstyled2} onClick={!locCodeShow && handleClickLoc}>확인</Button>
</Col>
<Col md={6} xs={4} id='loc-code' style={{
margin: '5px',
border: 'solid',
borderColor: 'rgb(110, 189, 142)',
display: 'flex',
justifyContent: 'center',
padding: '2px',
visibility: 'hidden',
transition: 'all 4s'
}}>
지역코드
</Col>
</Row> */}
<Button variant='light' className='mt-2' type="submit" id='formbtn'>
Sign Up Sign Up
</Button> </Button>
</Form> </Form>
...@@ -165,7 +155,6 @@ function SignupComp() { ...@@ -165,7 +155,6 @@ function SignupComp() {
<Row style={{ margin: 'auto', marginBottom: '5px', display: 'flex', justifyContent: 'center' }}> <Row style={{ margin: 'auto', marginBottom: '5px', display: 'flex', justifyContent: 'center' }}>
<a href="#;" onClick={LoginWithKakao} id='socialLink' > <a href="#;" onClick={LoginWithKakao} id='socialLink' >
{/* 세미콜론이 붙으면 최상단 이동 x */}
<img src='http://image.kmib.co.kr/online_image/2020/0626/611514110014734788_1.jpg' id='logpng' alt='KAKAO' /> <img src='http://image.kmib.co.kr/online_image/2020/0626/611514110014734788_1.jpg' id='logpng' alt='KAKAO' />
</a> </a>
</Row> </Row>
......
...@@ -40,8 +40,6 @@ function Home() { ...@@ -40,8 +40,6 @@ function Home() {
}) })
return ( return (
<Container fluid className='m-auto d-flex justify-content-center position-relative'> <Container fluid className='m-auto d-flex justify-content-center position-relative'>
<Row style={constyled} className='m-auto'> <Row style={constyled} className='m-auto'>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"description": "", "description": "",
"main": "init.js", "main": "init.js",
"scripts": { "scripts": {
"dev:server": "nodemon --exec babel-node src/init.js --delay 2", "dev:server": "nodemon --exec \"npx babel-node src/init.js\" --delay 2",
"start": "babel-node src/init.js" "start": "babel-node src/init.js"
}, },
"repository": { "repository": {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment