Commit d4672581 authored by Spark's avatar Spark
Browse files

usingaircon 기능 복구, 로그인 웹사이트 opn=>replace로 변경, 로컬존재시 첫변경 cancel

parent 8f21573b
...@@ -36,15 +36,12 @@ function LoginComp() { ...@@ -36,15 +36,12 @@ function LoginComp() {
function addressUrl() { function addressUrl() {
const afterAt = emailAddress.split('@')[1] const afterAt = emailAddress.split('@')[1]
if (afterAt == ('naver.com' || 'gmail.com' || 'daum.net')) { if (afterAt) {
const newLink = 'https://www.' + afterAt; const newLink = 'https://www.' + afterAt;
window.open(newLink); window.location.replace(newLink);
} }
if (afterAt == 'korea.ac.kr') { else if (afterAt == 'korea.ac.kr') {
window.open('https://www.gmail.com'); window.location.replace('https://www.gmail.com');
}
else {
window.open();
} }
} }
...@@ -97,7 +94,7 @@ function LoginComp() { ...@@ -97,7 +94,7 @@ function LoginComp() {
<Form style={inboxstyled} onSubmit={handleSubmit}> <Form style={inboxstyled} onSubmit={handleSubmit}>
<FloatingLabel label="Email"> <FloatingLabel label="Email">
<Form.Control type="email" placeholder="Email" onChange={handleChange} required/> <Form.Control type="email" placeholder="Email" onChange={handleChange} required />
</FloatingLabel> </FloatingLabel>
<Button variant='light' className='mt-3' id='formbtn' type='submit'> <Button variant='light' className='mt-3' id='formbtn' type='submit'>
LOGIN LOGIN
......
import axios from "axios"; import axios from "axios";
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { Form } from "react-bootstrap"; import { Form } from "react-bootstrap";
import { callUserInfo, checkCookies } from "../utils/CheckDB"; import { callUserInfo } from "../utils/CheckDB";
import { isLogined } from "./../utils/Auth"; import { isLogined } from "./../utils/Auth";
import { routesClient } from './../routesClient'; import { routesClient } from './../routesClient';
function UsingAircon() { function UsingAircon() {
const [airUsing, setAirUsing] = useState(false); const [airUsing, setAirUsing] = useState('');
// useEffect(() => { console.log("change airUsing", airUsing);
// callUserInfo().then((res) => {
// if (isLogined()) {
// setAirUsing(res.using_aircon)
// }
// else {
// console.log(res)
// }
// })
// }, [checkCookies()])
function airChange() { async function airChange() {
setAirUsing(!airUsing); setAirUsing(!airUsing);
async function Useair() { await axios.get(routesClient.usingAircon, { using_aircon: !airUsing })
const res = await axios.get(routesClient.usingAircon);
console.log(res);
} }
Useair(); useEffect(() => {
} callUserInfo().then((res) => {
setAirUsing(res[0]['using_aircon'])
})
}, [])
console.log("airUsing", airUsing);
return ( return (
<> <>
......
...@@ -8,6 +8,7 @@ import ChartLine from '../components/ChartLine'; ...@@ -8,6 +8,7 @@ import ChartLine from '../components/ChartLine';
import ChartDoughnut from '../components/ChartDoughnut'; import ChartDoughnut from '../components/ChartDoughnut';
import Donation from '../components/Donation'; import Donation from '../components/Donation';
import LocCodeChange from '../components/LocCodeChange'; import LocCodeChange from '../components/LocCodeChange';
import { callUserInfo } from '../utils/CheckDB';
function GetLocFirst() { function GetLocFirst() {
const constyled = { const constyled = {
...@@ -31,13 +32,28 @@ function GetLocFirst() { ...@@ -31,13 +32,28 @@ function GetLocFirst() {
padding: '0' padding: '0'
} }
const [existLoc, setExistLoc] = useState('')
const [show, setShow] = useState(false)
useEffect(() => {
callUserInfo().then((res) => {
setExistLoc(res[0]['loc_code'])
})
}, [])
useEffect(() => { useEffect(() => {
if (existLoc === '') {
setTimeout(function () { setTimeout(function () {
setShow(true) setShow(true)
}, 1500) }, 1500)
}, []) }
else {
setShow(false)
window.location.replace('/')
}
}, [existLoc])
const [show, setShow] = useState(false)
return ( return (
<Container className='m-auto d-flex position-relative' <Container className='m-auto d-flex position-relative'
......
...@@ -25,12 +25,9 @@ const postMail = async (email, token) => { ...@@ -25,12 +25,9 @@ const postMail = async (email, token) => {
from: `EUE Auth Supply <${envs.api.nodemailer.user}>`, from: `EUE Auth Supply <${envs.api.nodemailer.user}>`,
to: email, to: email,
subject: "EUE 사용자 계정 확인용 메일.", subject: "EUE 사용자 계정 확인용 메일.",
html: `<a href="${envs.server.protocol}://${envs.server.host}:${ html: `<a href="${envs.server.protocol}://${envs.server.host}:${envs.server.port
envs.server.port }${routes.base + routes.confirm}?token=${token}">${envs.server.protocol
}${routes.base + routes.confirm}?token=${token}">${ }://${envs.server.host}:${envs.server.port}${routes.base + routes.confirm
envs.server.protocol
}://${envs.server.host}:${envs.server.port}${
routes.base + routes.confirm
}?token=${token}</a>`, }?token=${token}</a>`,
}; };
...@@ -161,6 +158,7 @@ export const getConfirm = async (req, res) => { ...@@ -161,6 +158,7 @@ export const getConfirm = async (req, res) => {
`${envs.client.protocol}://${envs.client.host}:${envs.client.port}/first-local-code` `${envs.client.protocol}://${envs.client.host}:${envs.client.port}/first-local-code`
); );
} catch (err) { } catch (err) {
console.log('22', err);
res.json({ msg: resForm.msg.err, contents: { error: err } }); res.json({ msg: resForm.msg.err, contents: { error: err } });
} }
}; };
......
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