Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
students
eue
Commits
d4672581
Commit
d4672581
authored
Aug 02, 2021
by
Spark
Browse files
usingaircon 기능 복구, 로그인 웹사이트 opn=>replace로 변경, 로컬존재시 첫변경 cancel
parent
8f21573b
Changes
5
Hide whitespace changes
Inline
Side-by-side
client/src/App.js
View file @
d4672581
...
...
@@ -12,7 +12,7 @@ import GetLocFirst from './pages/GetLocFirst';
function
App
()
{
const
isLs
=
localStorage
.
getItem
(
'
login
'
)
function
loginDefault
()
{
...
...
@@ -29,7 +29,7 @@ function App() {
<
Route
path
=
'
/signup
'
component
=
{
SignupPage
}
/
>
<
Route
path
=
'
/login
'
component
=
{
LoginPage
}
/
>
<
Route
path
=
'
/first-local-code
'
component
=
{
GetLocFirst
}
/
>
<
PrivateRoute
path
=
'
/edit
'
>
<
EditPage
/>
<
/PrivateRoute
>
...
...
client/src/components/LoginComp.js
View file @
d4672581
...
...
@@ -36,15 +36,12 @@ function LoginComp() {
function
addressUrl
()
{
const
afterAt
=
emailAddress
.
split
(
'
@
'
)[
1
]
if
(
afterAt
==
(
'
naver.com
'
||
'
gmail.com
'
||
'
daum.net
'
)
)
{
if
(
afterAt
)
{
const
newLink
=
'
https://www.
'
+
afterAt
;
window
.
open
(
newLink
);
window
.
location
.
replace
(
newLink
);
}
if
(
afterAt
==
'
korea.ac.kr
'
)
{
window
.
open
(
'
https://www.gmail.com
'
);
}
else
{
window
.
open
();
else
if
(
afterAt
==
'
korea.ac.kr
'
)
{
window
.
location
.
replace
(
'
https://www.gmail.com
'
);
}
}
...
...
@@ -97,7 +94,7 @@ function LoginComp() {
<
Form
style
=
{
inboxstyled
}
onSubmit
=
{
handleSubmit
}
>
<
FloatingLabel
label
=
"
Email
"
>
<
Form
.
Control
type
=
"
email
"
placeholder
=
"
Email
"
onChange
=
{
handleChange
}
required
/>
<
Form
.
Control
type
=
"
email
"
placeholder
=
"
Email
"
onChange
=
{
handleChange
}
required
/>
<
/FloatingLabel
>
<
Button
variant
=
'
light
'
className
=
'
mt-3
'
id
=
'
formbtn
'
type
=
'
submit
'
>
LOGIN
...
...
client/src/components/UsingAircon.js
View file @
d4672581
import
axios
from
"
axios
"
;
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
{
Form
}
from
"
react-bootstrap
"
;
import
{
callUserInfo
,
checkCookies
}
from
"
../utils/CheckDB
"
;
import
{
callUserInfo
}
from
"
../utils/CheckDB
"
;
import
{
isLogined
}
from
"
./../utils/Auth
"
;
import
{
routesClient
}
from
'
./../routesClient
'
;
function
UsingAircon
()
{
const
[
airUsing
,
setAirUsing
]
=
useState
(
false
);
const
[
airUsing
,
setAirUsing
]
=
useState
(
''
);
// useEffect(() => {
// callUserInfo().then((res) => {
// if (isLogined()) {
// setAirUsing(res.using_aircon)
// }
// else {
// console.log(res)
// }
// })
// }, [checkCookies()])
console
.
log
(
"
change airUsing
"
,
airUsing
);
function
airChange
()
{
async
function
airChange
()
{
setAirUsing
(
!
airUsing
);
async
function
Useair
()
{
const
res
=
await
axios
.
get
(
routesClient
.
usingAircon
);
console
.
log
(
res
);
}
Useair
();
await
axios
.
get
(
routesClient
.
usingAircon
,
{
using_aircon
:
!
airUsing
})
}
console
.
log
(
"
airUsing
"
,
airUsing
);
useEffect
(()
=>
{
callUserInfo
().
then
((
res
)
=>
{
setAirUsing
(
res
[
0
][
'
using_aircon
'
])
})
},
[])
return
(
<>
...
...
client/src/pages/GetLocFirst.js
View file @
d4672581
...
...
@@ -8,6 +8,7 @@ import ChartLine from '../components/ChartLine';
import
ChartDoughnut
from
'
../components/ChartDoughnut
'
;
import
Donation
from
'
../components/Donation
'
;
import
LocCodeChange
from
'
../components/LocCodeChange
'
;
import
{
callUserInfo
}
from
'
../utils/CheckDB
'
;
function
GetLocFirst
()
{
const
constyled
=
{
...
...
@@ -31,13 +32,28 @@ function GetLocFirst() {
padding
:
'
0
'
}
const
[
existLoc
,
setExistLoc
]
=
useState
(
''
)
const
[
show
,
setShow
]
=
useState
(
false
)
useEffect
(()
=>
{
setTimeout
(
function
()
{
set
Show
(
true
)
}
,
1500
)
callUserInfo
().
then
((
res
)
=>
{
set
ExistLoc
(
res
[
0
][
'
loc_code
'
]
)
})
},
[])
const
[
show
,
setShow
]
=
useState
(
false
)
useEffect
(()
=>
{
if
(
existLoc
===
''
)
{
setTimeout
(
function
()
{
setShow
(
true
)
},
1500
)
}
else
{
setShow
(
false
)
window
.
location
.
replace
(
'
/
'
)
}
},
[
existLoc
])
return
(
<
Container
className
=
'
m-auto d-flex position-relative
'
...
...
server/src/controllers/userController.js
View file @
d4672581
...
...
@@ -25,13 +25,10 @@ const postMail = async (email, token) => {
from
:
`EUE Auth Supply <
${
envs
.
api
.
nodemailer
.
user
}
>`
,
to
:
email
,
subject
:
"
EUE 사용자 계정 확인용 메일.
"
,
html
:
`<a href="
${
envs
.
server
.
protocol
}
://
${
envs
.
server
.
host
}
:
${
envs
.
server
.
port
}${
routes
.
base
+
routes
.
confirm
}
?token=
${
token
}
">
${
envs
.
server
.
protocol
}
://
${
envs
.
server
.
host
}
:
${
envs
.
server
.
port
}${
routes
.
base
+
routes
.
confirm
}
?token=
${
token
}
</a>`
,
html
:
`<a href="
${
envs
.
server
.
protocol
}
://
${
envs
.
server
.
host
}
:
${
envs
.
server
.
port
}${
routes
.
base
+
routes
.
confirm
}
?token=
${
token
}
">
${
envs
.
server
.
protocol
}
://
${
envs
.
server
.
host
}
:
${
envs
.
server
.
port
}${
routes
.
base
+
routes
.
confirm
}
?token=
${
token
}
</a>`
,
};
try
{
...
...
@@ -161,6 +158,7 @@ export const getConfirm = async (req, res) => {
`
${
envs
.
client
.
protocol
}
://
${
envs
.
client
.
host
}
:
${
envs
.
client
.
port
}
/first-local-code`
);
}
catch
(
err
)
{
console
.
log
(
'
22
'
,
err
);
res
.
json
({
msg
:
resForm
.
msg
.
err
,
contents
:
{
error
:
err
}
});
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment