Commit 8eab06ce authored by minseok.park's avatar minseok.park

fetch test

parent 57ec7f17
This diff is collapsed.
......@@ -42,6 +42,7 @@
"highlight.js": "9.18.3",
"js-yaml": "~3.13",
"merge-stream": "~2.0",
"node-fetch": "^2.7.0",
"postcss-calc": "~7.0",
"postcss-custom-properties": "~9.1",
"postcss-import": "~12.0",
......
/* eslint-disable no-undef */
'use strict'
const fetch = require('node-fetch')
let isLogin = false
fetch('web/dms/api/auth/status')
fetch('https://swlab.bwg.co.kr/web/dms/api/auth/status')
.then((response) => {
console.log('response login >>>>> ', response)
if (!response.ok) {
document.location.href = 'https://swlab.bwg.co.kr/web/dms/home'
}
return response.text()
})
.then((data) => {
console.log(data)
if (data === 'logged_in') {
if (response.url === 'https://swlab.bwg.co.kr/web/dms/login') {
isLogin = true
}
})
......
This diff is collapsed.
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