Commit b9687379 authored by Lee Jin Ju's avatar Lee Jin Ju
Browse files

신경쓰지 마세요

parent e619c1ef
...@@ -6,7 +6,7 @@ var logger = require('morgan'); ...@@ -6,7 +6,7 @@ var logger = require('morgan');
var indexRouter = require('./routes/index'); var indexRouter = require('./routes/index');
var usersRouter = require('./routes/users'); var usersRouter = require('./routes/users');
const { connect } = require('http2'); const connect = require('./schemas');
var app = express(); var app = express();
connect(); connect();
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import Menu from '../Components/Menu'; import Menu from '../Components/Menu';
import styled from 'styled-components';
const Schedule = styled.div`
& ul {
list-style-type: none;
}
& .cd-schedule__events {
width: 100%;
> ul {
display: flex;
flex-wrap: nowrap;
}
}
& .cd-schedule__group {
flex-basis: 0;
flex-grow: 1;
}
& .cd-schedule__event {
position: absolute;
z-index: 3;
width: calc(100% + 2px); // top position and height will be set using js
left: -1px;
}
`
function Home() { function Home() {
return ( return (
<div> <div>
<Menu /> <Menu />
<div className="container"> <div className="container">
home <Schedule className="row cd-schedule cd-schedule--loading margin-top-lg margin-bottom-lg js-cd-schedule">
<div className="col-1 cd-schedule__timeline">
<ul>
<li><span>09:00</span></li>
<li><span>10:00</span></li>
<li><span>11:00</span></li>
<li><span>12:00</span></li>
<li><span>13:00</span></li>
<li><span>14:00</span></li>
<li><span>15:00</span></li>
<li><span>16:00</span></li>
<li><span>17:00</span></li>
<li><span>18:00</span></li>
<li><span>19:00</span></li>
<li><span>20:00</span></li>
<li><span>21:00</span></li>
<li><span>22:00</span></li>
</ul>
</div>
<div className="col-6 cd-schedule__events">
<ul>
<li className="cd-schedule__group">
<div className="cd-schedule__top-info"><span></span></div>
<ul>
<li className="cd-schedule__event">
<a data-start="10:00" data-end="12:00" data-content="event-abs-circuit" data-event="event-1" href="#0">
<em className="cd-schedule__name">확률론</em>
</a>
</li>
<li className="cd-schedule__event">
<a data-start="17:00" data-end="18:00" data-content="event-abs-circuit" data-event="event-1" href="#0">
<em className="cd-schedule__name">수치해석학</em>
</a>
</li>
</ul>
</li>
<li className="cd-schedule__group">
<div className="cd-schedule__top-info"><span></span></div>
<ul>
<li className="cd-schedule__event">
<a data-start="11:00" data-end="12:00" data-content="event-abs-circuit" data-event="event-1" href="#0">
<em className="cd-schedule__name">해석학</em>
</a>
</li>
<li className="cd-schedule__event">
<a data-start="16:00" data-end="18:00" data-content="event-abs-circuit" data-event="event-1" href="#0">
<em className="cd-schedule__name">수치해석학</em>
</a>
</li>
</ul>
</li>
<li className="cd-schedule__group">
<div className="cd-schedule__top-info"><span></span></div>
<ul>
<li className="cd-schedule__event">
<a data-start="9:00" data-end="10:00" data-content="event-abs-circuit" data-event="event-1" href="#0">
<em className="cd-schedule__name">산업수학</em>
</a>
</li>
<li className="cd-schedule__event">
<a data-start="18:00" data-end="19:00" data-content="event-abs-circuit" data-event="event-1" href="#0">
<em className="cd-schedule__name">해석학</em>
</a>
</li>
</ul>
</li>
<li className="cd-schedule__group">
<div className="cd-schedule__top-info"><span></span></div>
<ul>
<li className="cd-schedule__event">
<a data-start="9:00" data-end="11:00" data-content="event-abs-circuit" data-event="event-1" href="#0">
<em className="cd-schedule__name">해석학</em>
</a>
</li>
<li className="cd-schedule__event">
<a data-start="11:00" data-end="12:00" data-content="event-abs-circuit" data-event="event-1" href="#0">
<em className="cd-schedule__name">확률론</em>
</a>
</li>
<li className="cd-schedule__event">
<a data-start="16:00" data-end="17:00" data-content="event-abs-circuit" data-event="event-1" href="#0">
<em className="cd-schedule__name">수치해석학</em>
</a>
</li>
</ul>
</li>
<li className="cd-schedule__group">
<div className="cd-schedule__top-info"><span></span></div>
<ul>
<li className="cd-schedule__event">
<a data-start="13:00" data-end="15:00" data-content="event-abs-circuit" data-event="event-1" href="#0">
<em className="cd-schedule__name">산업수학</em>
</a>
</li>
</ul>
</li>
</ul>
</div>
{/* <div class="cd-schedule-modal">
<header class="cd-schedule-modal__header">
<div class="cd-schedule-modal__content">
<span class="cd-schedule-modal__date"></span>
<h3 class="cd-schedule-modal__name"></h3>
</div>
<div class="cd-schedule-modal__header-bg"></div>
</header>
<div class="cd-schedule-modal__body">
<div class="cd-schedule-modal__event-info"></div>
<div class="cd-schedule-modal__body-bg"></div>
</div>
<a href="#0" class="cd-schedule-modal__close text-replace">Close</a>
</div> */}
</Schedule>
</div> </div>
</div> </div>
) )
......
const mongoose = require('mongoose');
module.exports = () => {
const connect = () => {
if (process.env.NODE_ENV !== 'production') {
mongoose.set('debug', true);
}
mongoose.connect('mongodb://hijinju:highlight@localhost:27017/admin', {
dbName: 'KU_Rental',
}, (error) => {
if (error) {
console.log('몽고디비 연결 에러', error);
} else {
console.log('몽고디비 연결 성공');
}
});
};
connect();
mongoose.connection.on('error', (error) => {
console.error('몽고디비 연결 에러', error);
});
mongoose.connection.on('disconnected', () => {
console.error('몽고디비 연결이 끊겼습니다. 연결을 재시도합니다.');
connect();
});
require('./user');
require('./reserve');
};
const mongoose = require('mongoose');
const { Schema } = mongoose;
const reserveSchema = new Schema({
date: {
type: String,
},
time: {
type: String,
},
room:{
type: String,
},
name: { //대표자 이름
type: String,
},
id:{
type: Number,
},
reason: {
type: String,
},
member: {
type: String,
},
approve: {
type: Boolean,
},
num: {
type: Number,
},
});
module.exports = mongoose.model('Reserve', reserveSchema);
\ No newline at end of file
const mongoose = require('mongoose');
const bcrypt = require("bcrypt");
const saltRounds = 10;
const { Schema } = mongoose;
const userSchema = new Schema({
name: {
type: String,
required: true,
},
password: {
type: String,
},
id: {
type: Number,
required: true,
},
});
userSchema.pre("save", function (next) {
let user = this; //User모델 자체를 가르킴.
//model 안의 paswsword가 변경 또는 생성될 때 암호화
if (user.isModified("password")) {
bcrypt.genSalt(saltRounds, function (err, salt) {
if (err) return next(err);
bcrypt.hash(user.password, salt, function (err, hash) {
if (err) return next(err);
user.password = hash;
next();
});
});
} else {
next();
}
});
module.exports = mongoose.model('User', userSchema);
\ No newline at end of file
...@@ -4,30 +4,22 @@ import * as serviceWorker from './serviceWorker'; ...@@ -4,30 +4,22 @@ import * as serviceWorker from './serviceWorker';
import { BrowserRouter as Router, Route, Redirect, Switch } from 'react-router-dom'; import { BrowserRouter as Router, Route, Redirect, Switch } from 'react-router-dom';
import 'bootstrap/dist/css/bootstrap.css'; import 'bootstrap/dist/css/bootstrap.css';
<<<<<<< HEAD
import Login from './Pages/LoginPage'; import Login from './Pages/LoginPage';
import Home from './Pages/HomePage'; import Home from './Pages/HomePage';
import Signup from './Pages/SignupPage'; import Signup from './Pages/SignupPage';
import Apply from './Pages/ApplyPage'; import Apply from './Pages/ApplyPage';
import Check from './Pages/CheckPage'; import Check from './Pages/CheckPage';
import Notice from './Pages/NoticePage'; import Notice from './Pages/NoticePage';
=======
import Login from './Pages/Login';
import Home from './Pages/Home';
>>>>>>> origin/rkyoung7
ReactDOM.render( ReactDOM.render(
<Router> <Router>
<Switch> <Switch>
<Route exact path="/" component={Login} /> <Route exact path="/" component={Login} />
<Route path="/home" component={Home} /> <Route path="/home" component={Home} />
<<<<<<< HEAD
<Route path="/signup" component={Signup} /> <Route path="/signup" component={Signup} />
<Route path="/apply" component={Apply} /> <Route path="/apply" component={Apply} />
<Route path="/check" component={Check} /> <Route path="/check" component={Check} />
<Route path="/notice" component={Notice} /> <Route path="/notice" component={Notice} />
=======
>>>>>>> origin/rkyoung7
</Switch> </Switch>
</Router>, </Router>,
document.getElementById('root') document.getElementById('root')
...@@ -36,8 +28,4 @@ ReactDOM.render( ...@@ -36,8 +28,4 @@ ReactDOM.render(
// If you want your app to work offline and load faster, you can change // If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls. // unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA // Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister(); serviceWorker.unregister();
<<<<<<< HEAD \ No newline at end of file
=======
>>>>>>> origin/rkyoung7
This diff is collapsed.
...@@ -12,10 +12,7 @@ ...@@ -12,10 +12,7 @@
"dotenv": "^8.2.0", "dotenv": "^8.2.0",
"express": "~4.16.1", "express": "~4.16.1",
"http-errors": "~1.6.3", "http-errors": "~1.6.3",
<<<<<<< HEAD
"jsonwebtoken": "^8.5.1", "jsonwebtoken": "^8.5.1",
=======
>>>>>>> origin/rkyoung7
"mongoose": "^5.10.5", "mongoose": "^5.10.5",
"morgan": "~1.9.1", "morgan": "~1.9.1",
"pug": "2.0.0-beta11" "pug": "2.0.0-beta11"
......
...@@ -5,11 +5,7 @@ module.exports = () => { ...@@ -5,11 +5,7 @@ module.exports = () => {
if (process.env.NODE_ENV !== 'production') { if (process.env.NODE_ENV !== 'production') {
mongoose.set('debug', true); mongoose.set('debug', true);
} }
<<<<<<< HEAD
mongoose.connect('mongodb://hijinju:highlight@localhost:27017/admin', { mongoose.connect('mongodb://hijinju:highlight@localhost:27017/admin', {
=======
mongoose.connect('mongodb://rkyoung7:rkdud127@localhost:27017/admin', {
>>>>>>> origin/rkyoung7
dbName: 'KU_Rental', dbName: 'KU_Rental',
}, (error) => { }, (error) => {
if (error) { if (error) {
...@@ -29,9 +25,4 @@ module.exports = () => { ...@@ -29,9 +25,4 @@ module.exports = () => {
}); });
require('./user'); require('./user');
require('./reserve'); require('./reserve');
};
<<<<<<< HEAD \ No newline at end of file
};
=======
};
>>>>>>> origin/rkyoung7
...@@ -41,8 +41,4 @@ const reserveSchema = new Schema({ ...@@ -41,8 +41,4 @@ const reserveSchema = new Schema({
}); });
<<<<<<< HEAD
module.exports = mongoose.model('Reserve', reserveSchema); module.exports = mongoose.model('Reserve', reserveSchema);
=======
module.exports = mongoose.model('Reserve', reserveSchema);
>>>>>>> origin/rkyoung7
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