Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
MajorBook - Team202
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LeeYongJae
MajorBook - Team202
Commits
5f0d1e11
Commit
5f0d1e11
authored
5 years ago
by
LeeYongJae
Browse files
Options
Downloads
Patches
Plain Diff
Login with session2
parent
1aea2c9c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
frontend/src/App.vue
+21
-27
21 additions, 27 deletions
frontend/src/App.vue
frontend/src/components/login/Login.vue
+4
-4
4 additions, 4 deletions
frontend/src/components/login/Login.vue
frontend/src/components/login/Logout.vue
+2
-0
2 additions, 0 deletions
frontend/src/components/login/Logout.vue
with
27 additions
and
31 deletions
frontend/src/App.vue
+
21
−
27
View file @
5f0d1e11
...
...
@@ -6,15 +6,13 @@
<span
class=
"md-title"
>
MajorBook
</span>
</div>
<div
style=
"flex:1"
>
<div
align=
"right"
>
<div
v-if=
"!checkLoggedIn"
>
<Login
/>
<SignUp
/>
</div>
<div
v-if=
"checkLoggedIn"
>
<Logout
/>
</div>
<div
style=
"flex:1; height:20px"
align=
"right"
>
<div
v-if=
"isLoggedIn === false"
>
<Login
/>
<SignUp
/>
</div>
<div
v-else
>
<Logout
/>
</div>
</div>
...
...
@@ -22,11 +20,7 @@
<md-tabs
class=
"md-primary"
style=
"margin: auto; height: 30px"
>
<md-tab
id=
"tab-home"
md-label=
"Home"
to=
"/home"
></md-tab>
<md-tab
id=
"tab-profile"
md-label=
"Profile"
to=
"/profile"
></md-tab>
<md-tab
id=
"tab-list"
md-label=
"전공서적보기"
to=
"/BookSearchPage"
></md-tab>
<md-tab
id=
"tab-list"
md-label=
"전공서적보기"
to=
"/BookSearchPage"
></md-tab>
</md-tabs>
</div>
</md-app-toolbar>
...
...
@@ -63,25 +57,25 @@ export default {
},
methods
:
{
checkSession
()
{
this
.
$http
.
get
(
"
/api/login/checkSession
"
).
then
(
function
(
response
)
{
//
console.log(response.data);
this
.
$http
.
get
(
"
/api/login/checkSession
"
).
then
(
response
=>
{
console
.
log
(
response
.
data
);
if
(
response
.
data
===
true
)
{
return
true
;
return
(
this
.
isLoggedIn
=
true
)
;
}
else
{
return
false
;
return
(
this
.
isLoggedIn
=
false
)
;
}
});
}
},
computed
:
{
checkLoggedIn
()
{
console
.
log
(
this
.
checkSession
());
if
(
this
.
checkSession
()
===
true
)
{
return
true
;
}
return
false
;
}
}
// computed: {
// checkLoggedIn() {
// console.log(this.checkSession());
// if (this.checkSession() === true) {
// return true;
// }
// return false;
// }
// }
};
</
script
>
...
...
This diff is collapsed.
Click to expand it.
frontend/src/components/login/Login.vue
+
4
−
4
View file @
5f0d1e11
...
...
@@ -13,10 +13,8 @@
<md-input
v-model=
"user.password"
type=
"password"
/>
</md-field>
<md-button
class=
"md-primary"
v-on:click=
"login"
>
Login
</md-button>
<md-button
class=
"md-primary"
v-on:click=
"active = false"
>
Close
</md-button
>
<md-button
class=
"md-raised md-primary"
v-on:click=
"login"
>
Login
</md-button>
<md-button
class=
"md-primary"
v-on:click=
"active = false"
>
Close
</md-button>
</md-dialog>
</div>
</
template
>
...
...
@@ -27,6 +25,7 @@ import VueMaterial from "vue-material";
import
"
vue-material/dist/vue-material.min.css
"
;
import
"
vue-material/dist/theme/default.css
"
;
Vue
.
use
(
VueMaterial
);
export
default
{
data
:
function
()
{
return
{
...
...
@@ -50,6 +49,7 @@ export default {
alert
(
"
success login
"
);
//this.$router.push("Logout");
this
.
active
=
false
;
location
.
reload
();
},
error
=>
{
// error 를 보여줌
...
...
This diff is collapsed.
Click to expand it.
frontend/src/components/login/Logout.vue
+
2
−
0
View file @
5f0d1e11
...
...
@@ -20,7 +20,9 @@ export default {
console
.
log
(
"
Logout start
"
);
this
.
$http
.
get
(
"
/api/login/logout
"
).
then
(
response
=>
{
if
(
response
)
{
alert
(
"
success logout
"
);
//this.$router.push("home");
location
.
reload
();
}
});
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment