Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SWLab UI
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
SWD
SWLab UI
Commits
57ec7f17
Commit
57ec7f17
authored
5 months ago
by
minseok.park
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
login check test
parent
23a8e158
Pipeline
#20718
failed with stages
in 3 minutes and 24 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
17 deletions
+31
-17
check-login.js
src/helpers/check-login.js
+26
-0
09-check-login.js
src/js/09-check-login.js
+0
-15
header-content.hbs
src/partials/header-content.hbs
+5
-2
No files found.
src/helpers/check-login.js
0 → 100644
View file @
57ec7f17
/* eslint-disable no-undef */
'use strict'
let
isLogin
=
false
fetch
(
'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'
)
{
isLogin
=
true
}
})
.
catch
((
error
)
=>
{
console
.
error
(
'Error checking login status:'
,
error
)
})
module
.
exports
=
isLogin
This diff is collapsed.
Click to expand it.
src/js/09-check-login.js
deleted
100644 → 0
View file @
23a8e158
/* eslint-disable no-undef */
;(
function
()
{
'use strict'
fetch
(
'web/dms/api/auth/status'
)
.
then
((
response
)
=>
{
console
.
log
(
'response login >>>>> '
,
response
)
if
(
response
.
url
===
'https://swlab.bwg.co.kr/web/dms/login'
)
{
document
.
location
.
href
=
'https://swlab.bwg.co.kr/web/dms/home'
}
})
.
catch
((
error
)
=>
{
console
.
error
(
'Error checking login status:'
,
error
)
})
})()
This diff is collapsed.
Click to expand it.
src/partials/header-content.hbs
View file @
57ec7f17
<header
class=
"header"
>
<nav
class=
"navbar"
>
<div
class=
"navbar-brand"
>
<a
class=
"navbar-item"
href=
"https://swlab.bwg.co.kr/"
>
{{!-- <a id="logo" class="navbar-item"> --}}
{{#if
isLogin
}}
<a
class=
"navbar-item"
href=
"https://swlab.bwg.co.kr/web/main"
>
{{else}}
<a
class=
"navbar-item"
href=
"https://swlab.bwg.co.kr/web/dms/home"
>
{{/if}}
<i
class=
"navbar-logo"
></i>
<div
class=
"navbar-title-contents"
>
<span
class=
"navbar-title"
>
SWLab
</span>
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment