박시진

[Add]Test file (check login_success&info)

......@@ -161,15 +161,5 @@ exports.getSubjects = getSubjects;
exports.close = close;
//console test
async function runrun() {
page = await login("2021105253", "lorem");
await getPeed(page);
await getSubjects(page);
await close();
console.log(Info);
console.log(Info.subjects)
}
runrun();
......
const express = require("express");
const router = express.Router();
const { getPeed, getSubjects, login, close } = require("./E_Campus.js");
async function runrun() {
page = await login("lorem", "lorem");
await getPeed(page);
await getSubjects(page);
await close();
console.log(Info);
console.log(Info.subjects)
}
runrun();
\ No newline at end of file
const express = require("express");
const router = express.Router();
// const { getPeed, getSubjects, login } = require("../libs/E_Campus.js");
const { login } = require("../libs/E_Campus.js");
const { getPeed, getSubjects, login, close } = require("../libs/E_Campus.js");
router.post("/", async (req, res) => {
console.log(`listened /login ${req.body.id} ${req.body.pw}`);
const Info = await login(req.body.id, req.body.pw);
if (Info.id != "null") {
const page = await login(req.body.id, req.body.pw);
if (page) {
try {
// const peed = await getPeed(page);
res.send("success");
} catch (e) {
console.log(e);
......