Toggle navigation
Toggle navigation
This project
Loading...
Sign in
오인제
/
Tunnel
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
정의왕
2021-12-08 22:49:09 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8cc5badf7ee4c1d4f314fd2f63e2f91155c5bec5
8cc5badf
1 parent
3dd290fd
Fix file
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
26 deletions
tunnel_BE/server/routes/login.js
turnel_FE/src/App.js
turnel_FE/src/component/views/LandingPage/LandingPage.js
tunnel_BE/server/routes/login.js
View file @
8cc5bad
...
...
@@ -17,18 +17,19 @@ router.post('/',(req,res)=>{
//id와 일치하는 정보가 없는경우
if
(
result
===
null
||
result
===
undefined
){
console
.
log
(
"일치하는 id가 없습니다."
)
res
.
s
endStatus
(
401
);
res
.
s
tatus
(
401
).
send
(
"idError"
);
}
//비밀번호 불일치
else
if
(
result
.
dataValues
.
pw
!=
req
.
body
.
Password
){
console
.
log
(
"일치하는 pw가 없습니다."
)
res
.
s
endStatus
(
401
);
res
.
s
tatus
(
401
).
send
(
"pwError"
);
}
else
if
(
result
.
dataValues
.
pw
==
req
.
body
.
Password
){
req
.
session
.
id
=
result
.
dataValues
.
id
;
req
.
session
.
name
=
result
.
dataValues
.
name
;
req
.
session
.
personality
=
result
.
dataValues
.
personality
;
req
.
session
.
status
=
result
.
dataValues
.
status
;
req
.
session
.
isAuthorized
=
true
;
console
.
log
(
"Login"
);
res
.
sendStatus
(
200
);
}
...
...
turnel_FE/src/App.js
View file @
8cc5bad
import
{
BrowserRouter
as
Router
,
Route
,
Routes
}
from
"react-router-dom"
;
import
{
BrowserRouter
as
R
edirect
,
R
outer
,
Route
,
Routes
}
from
"react-router-dom"
;
import
MainPage
from
"./component/views/MainPage/MainPage"
;
import
LoginPage
from
"./component/views/LoginPage/LoginPage"
;
import
RegisterPage
from
"./component/views/RegisterPage/RegisterPage"
;
import
"./static/fonts/font.css"
;
import
LandingPage
from
"./component/views/LandingPage/LandingPage"
;
function
App
()
{
let
isAuthorized
=
sessionStorage
.
getItem
(
"isAuthorized"
);
//
return
(
<
Router
>
<
div
>
{
!
isAuthorized
?
<
Redirect
to
=
"/login"
/>
:
<
Redirect
to
=
"/"
/>
}
{
!
isAuthorized
?
<
Redirect
to
=
"/login"
/>
:
<
Redirect
to
=
"/
main
"
/>
}
<
Routes
>
<
Route
exact
path
=
"/"
element
=
{
<
LandingPage
/>
}
/
>
<
Route
exact
path
=
"/login"
element
=
{
<
LoginPage
/>
}
/
>
<
Route
exact
path
=
"/main"
element
=
{
<
MainPage
/>
}
/
>
<
Route
exact
path
=
"/register"
element
=
{
<
RegisterPage
/>
}
/
>
...
...
turnel_FE/src/component/views/LandingPage/LandingPage.js
deleted
100644 → 0
View file @
3dd290f
import
React
from
'react'
//import axios from 'axios'
// import { response } from 'express'
function
LandingPage
()
{
// useEffect(() => {
// axios.get('/api/hello')
// .then(response => console.log(response.data))
// }, [])
return
(
<
div
>
LandingPage
<
/div
>
)
}
export
default
LandingPage
Please
register
or
login
to post a comment