Commit d4672581 authored by Spark's avatar Spark
Browse files

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

parent 8f21573b
......@@ -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
......
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);
await axios.get(routesClient.usingAircon, { using_aircon: !airUsing })
}
Useair();
}
useEffect(() => {
callUserInfo().then((res) => {
setAirUsing(res[0]['using_aircon'])
})
}, [])
console.log("airUsing", airUsing);
return (
<>
......
......@@ -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(() => {
callUserInfo().then((res) => {
setExistLoc(res[0]['loc_code'])
})
}, [])
useEffect(() => {
if (existLoc === '') {
setTimeout(function () {
setShow(true)
}, 1500)
}, [])
}
else {
setShow(false)
window.location.replace('/')
}
}, [existLoc])
const [show, setShow] = useState(false)
return (
<Container className='m-auto d-flex position-relative'
......
......@@ -25,12 +25,9 @@ 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
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>`,
};
......@@ -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 } });
}
};
......
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