Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김건희
/
OSSW_Weather_Briefing
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
김건희
2022-06-03 03:54:23 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4af707b75a3ff31219f7242093c2ccb80b587a64
4af707b7
1 parent
07ca8cc3
[Update] Weather Redux File
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
19 deletions
weather_briefing/src/component/views/RegisterPage/RegisterPage.js
weather_briefing/src/modules/user.js
weather_briefing/src/modules/weather.js
weather_briefing/src/component/views/RegisterPage/RegisterPage.js
View file @
4af707b
...
...
@@ -106,19 +106,19 @@ function RegisterPage(props) {
dispatch
(
register
(
UserData
));
registerResult
.
then
((
result
)
=>
{
console
.
log
(
result
);
if
(
result
.
registerSuccess
===
'1'
)
{
alert
(
'회원 가입 완료!'
);
navigate
(
'/login'
);
}
else
if
(
result
.
registerSuccess
===
'0'
)
{
alert
(
'중복된 아이디 존재ㅠㅠ'
);
}
else
{
alert
(
'회원 가입 실패ㅜㅜ'
);
}
})
console
.
log
(
result
);
if
(
result
.
registerSuccess
===
'1'
)
{
alert
(
'회원 가입 완료!'
);
navigate
(
'/login'
);
}
else
if
(
result
.
registerSuccess
===
'0'
)
{
alert
(
'중복된 아이디 존재ㅠㅠ'
);
}
else
{
alert
(
'회원 가입 실패ㅜㅜ'
);
}
})
};
...
...
weather_briefing/src/modules/user.js
View file @
4af707b
...
...
@@ -3,9 +3,9 @@ import axios from 'axios';
const
USER_REGISTER
=
'user/REGISTER'
;
const
USER_LOGIN
=
'user/LOGIN'
;
export
function
register
(
dataToSubmit
)
{
export
async
function
register
(
dataToSubmit
)
{
const
req
=
axios
.
post
(
'http://localhost:4000/api/register'
,
dataToSubmit
)
const
req
=
a
wait
a
xios
.
post
(
'http://localhost:4000/api/register'
,
dataToSubmit
)
.
then
(
res
=>
res
.
data
);
return
{
...
...
weather_briefing/src/modules/weather.js
View file @
4af707b
import
axios
from
"axios"
;
const
WEATHER_ADDRESS
=
'weather/ADDRESS'
;
const
WEATHER_COORDINATE
=
'weather/COORDINATE'
;
const
WEATHER_TODAY_INFORMATION
=
'weather/TODAY_INFORMATION'
;
export
function
address
()
{
const
req
=
axios
.
post
(
'http://localhost:4000/api/address'
)
.
then
(
res
=>
res
.
data
);
return
{
type
:
WEATHER_ADDRESS
,
payload
:
req
,
}
}
export
function
coordinate
(
dataToSubmit
)
{
const
req
=
axios
.
post
(
'http://localhost:4000/api/
address
'
,
dataToSubmit
)
const
req
=
axios
.
post
(
'http://localhost:4000/api/
cordinate
'
,
dataToSubmit
)
.
then
(
res
=>
res
.
data
);
return
{
type
:
WEATHER_
ADDRESS
,
type
:
WEATHER_
COORDINATE
,
payload
:
req
,
}
};
export
function
information
(
dataToSubmit
)
{
const
req
=
axios
.
post
(
'http://localhost:4000/api/
mainpage
'
,
dataToSubmit
)
const
req
=
axios
.
post
(
'http://localhost:4000/api/
weather
'
,
dataToSubmit
)
.
then
(
res
=>
res
.
data
);
return
{
type
:
WEATHER_TODAY_INFORMATION
,
payload
:
req
,
}
}
};
export
default
function
(
state
=
{},
action
)
{
switch
(
action
.
type
)
{
case
WEATHER_ADDRESS
:
return
{
...
state
,
address
:
action
.
payload
};
break
;
case
WEATHER_COORDINATE
:
return
{
...
state
,
dot
:
action
.
payload
};
break
;
case
WEATHER_TODAY_INFORMATION
:
...
...
Please
register
or
login
to post a comment