Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
jijisa
/
porch
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
096be5b7
authored
Feb 27, 2017
by
Heechul Kim
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
quasar update
parent
f5023a56
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
183 additions
and
7 deletions
quasar/src/App.vue
quasar/src/components/Login.vue
quasar/src/components/adminLogin.vue
quasar/src/router.js
quasar/src/App.vue
View file @
096be5b7
...
@@ -7,10 +7,29 @@
...
@@ -7,10 +7,29 @@
<q-tabs
slot=
"navigation"
class=
"purple"
>
<q-tabs
slot=
"navigation"
class=
"purple"
>
<q-tab
<q-tab
v-if=
"this.$store.state.login"
v-if=
"this.$store.state.login"
icon=
"cast"
route=
"/os"
exact
replace
@
click=
"trigger()"
>
OS 배포
</q-tab>
<q-tab
v-if=
"this.$store.state.login"
icon=
"send"
route=
"/play"
exact
replace
@
click=
"trigger()"
>
App 배포
</q-tab>
<q-tab
v-if=
"this.$store.state.login"
icon=
"create_new_folder"
icon=
"create_new_folder"
route=
"/section"
route=
"/section"
exact
exact
replace
replace
@
click=
"trigger()"
>
그룹
>
그룹
</q-tab>
</q-tab>
<q-tab
<q-tab
...
@@ -19,6 +38,7 @@
...
@@ -19,6 +38,7 @@
route=
"/machine"
route=
"/machine"
exact
exact
replace
replace
@
click=
"trigger()"
>
서버
>
서버
</q-tab>
</q-tab>
<q-tab
<q-tab
...
@@ -27,6 +47,7 @@
...
@@ -27,6 +47,7 @@
route=
"/app"
route=
"/app"
exact
exact
replace
replace
@
click=
"trigger()"
>
애플리케이션
>
애플리케이션
</q-tab>
</q-tab>
<q-tab
<q-tab
...
@@ -35,6 +56,7 @@
...
@@ -35,6 +56,7 @@
route=
"/account"
route=
"/account"
exact
exact
replace
replace
@
click=
"trigger()"
>
사용자
>
사용자
</q-tab>
</q-tab>
<q-tab
<q-tab
...
@@ -61,6 +83,13 @@
...
@@ -61,6 +83,13 @@
<div
class=
"layout-padding"
>
<div
class=
"layout-padding"
>
<div
id=
"q-app"
>
<div
id=
"q-app"
>
<router-view></router-view>
<router-view></router-view>
<q-ajax-bar
ref=
"bar"
:position=
"position"
:size=
"computedSize"
:color=
"color"
>
</q-ajax-bar>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -74,12 +103,36 @@ export default {
...
@@ -74,12 +103,36 @@ export default {
name
:
'app'
,
name
:
'app'
,
data
()
{
data
()
{
return
{
return
{
porchVersion
:
'0.0.1'
porchVersion
:
'0.0.1'
,
position
:
'bottom'
,
reverse
:
false
,
size
:
12
,
color
:
'#e21b0c'
}
},
computed
:
{
computedSize
()
{
return
this
.
size
+
'px'
}
}
},
},
methods
:
{
methods
:
{
updateMenu
:
function
()
{
updateMenu
:
function
()
{
this
.
login
=
this
.
$store
.
state
.
login
if
(
this
.
$cookie
.
get
(
'token'
))
{
this
.
$store
.
commit
(
'loggedIn'
,
true
)
this
.
$store
.
commit
(
'setName'
,
this
.
$cookie
.
get
(
'name'
))
this
.
$store
.
commit
(
'setRole'
,
this
.
$cookie
.
get
(
'role'
))
this
.
$store
.
commit
(
'setToken'
,
this
.
$cookie
.
get
(
'token'
))
this
.
$store
.
commit
(
'setRefreshToken'
,
this
.
$cookie
.
get
(
'refreshToken'
))
}
},
trigger
()
{
this
.
$refs
.
bar
.
start
()
setTimeout
(()
=>
{
if
(
this
.
$refs
.
bar
)
{
this
.
$refs
.
bar
.
stop
()
}
},
5000
)
}
}
},
},
updated
()
{
updated
()
{
...
...
quasar/src/components/Login.vue
View file @
096be5b7
...
@@ -35,7 +35,13 @@
...
@@ -35,7 +35,13 @@
</button>
</button>
</div>
</div>
</div>
</div>
<p></p>
<p></p>
<div>
<router-link
to=
"/admin/login"
>
관리자 로그인
</router-link>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -67,10 +73,10 @@ export default {
...
@@ -67,10 +73,10 @@ export default {
}
}
this
.
$http
.
post
(
url
,
dReqBody
,
headers
).
then
(
response
=>
{
this
.
$http
.
post
(
url
,
dReqBody
,
headers
).
then
(
response
=>
{
// save token cookie
// save token cookie
//
this.$cookie.set('token', response.body.token)
this
.
$cookie
.
set
(
'token'
,
response
.
body
.
token
)
// this.$cookie.set('refresh_t
oken', response.body.refresh_token)
this
.
$cookie
.
set
(
'refreshT
oken'
,
response
.
body
.
refresh_token
)
//
this.$cookie.set('role', response.body.role)
this
.
$cookie
.
set
(
'role'
,
response
.
body
.
role
)
// this.$cookie.set('name', response.body
.name)
this
.
$cookie
.
set
(
'name'
,
this
.
name
)
// state update
// state update
this
.
$store
.
commit
(
'loggedIn'
,
true
)
this
.
$store
.
commit
(
'loggedIn'
,
true
)
this
.
$store
.
commit
(
'setName'
,
this
.
name
)
this
.
$store
.
commit
(
'setName'
,
this
.
name
)
...
...
quasar/src/components/adminLogin.vue
0 → 100644
View file @
096be5b7
<
template
>
<div
class=
"login-page bg-light column items-center"
>
<div
class=
"login-logo bg-purple flex items-center justify-center"
>
UDAM 관리자 로그인
</div>
<div>
<div
class=
"login-card card bg-white column items-center justify-center"
>
<div
class=
"column"
>
<div
class=
"stacked-label width-1of3"
>
<input
type=
"text"
v-model=
"name"
ref=
"name"
placeholder=
"사용자 ID를 입력하세요."
>
<label>
사용자 ID
</label>
</div>
<div
class=
"stacked-label"
>
<input
type=
"password"
v-model=
"pass"
v-on:keyup
.
enter=
"auth"
placeholder=
"비밀번호를 입력하세요."
>
<label>
비밀번호
</label>
</div>
<div>
<button
class=
"purple"
@
click=
"auth"
>
관리자 로그인
</button>
</div>
</div>
</div>
</div>
</div>
</
template
>
<
script
>
import
{
API_URL
}
from
'config'
import
{
Toast
}
from
'quasar'
export
default
{
name
:
'login'
,
data
()
{
return
{
name
:
''
,
pass
:
''
}
},
methods
:
{
auth
:
function
()
{
const
url
=
API_URL
+
'/account/admin/login/'
const
dReqBody
=
{
name
:
this
.
name
,
pass
:
this
.
pass
}
const
headers
=
{
headers
:
{
}
}
this
.
$http
.
post
(
url
,
dReqBody
,
headers
).
then
(
response
=>
{
this
.
$cookie
.
set
(
'token'
,
response
.
body
.
token
)
this
.
$cookie
.
set
(
'refreshToken'
,
response
.
body
.
refresh_token
)
this
.
$cookie
.
set
(
'role'
,
response
.
body
.
role
)
this
.
$cookie
.
set
(
'name'
,
this
.
name
)
this
.
$store
.
commit
(
'loggedIn'
,
true
)
this
.
$store
.
commit
(
'setName'
,
this
.
name
)
this
.
$store
.
commit
(
'setRole'
,
response
.
body
.
role
)
this
.
$store
.
commit
(
'setToken'
,
response
.
body
.
token
)
this
.
$store
.
commit
(
'setRefreshToken'
,
response
.
body
.
refresh_token
)
this
.
$router
.
push
(
'/machine'
)
},
response
=>
{
Toast
.
create
.
negative
({
html
:
'로그인 실패: '
+
response
.
body
.
error
,
timeout
:
5000
})
this
.
name
=
''
this
.
pass
=
''
this
.
$refs
.
name
.
focus
()
})
}
},
mounted
()
{
this
.
$refs
.
name
.
focus
()
}
}
</
script
>
<
style
lang=
"stylus"
>
.login-page
.login-logo
height
10vh
width
60
%
padding-top
1vh
font-size
3vmax
color
rgba
(
255
,
255
,
255
,
.7
)
overflow
hidden
.login-card
margin-top
10px
width
90vw
max-width
600px
padding
20px
</
style
>
quasar/src/router.js
View file @
096be5b7
...
@@ -22,6 +22,11 @@ export default new VueRouter({
...
@@ -22,6 +22,11 @@ export default new VueRouter({
routes
:
[
routes
:
[
{
{
path
:
'/admin/login'
,
name
:
'adminLogin'
,
component
:
load
(
'adminLogin'
)
},
{
path
:
'/login'
,
path
:
'/login'
,
name
:
'login'
,
name
:
'login'
,
component
:
load
(
'Login'
)
component
:
load
(
'Login'
)
...
@@ -82,6 +87,11 @@ export default new VueRouter({
...
@@ -82,6 +87,11 @@ export default new VueRouter({
component
:
load
(
'account/Pass'
)
component
:
load
(
'account/Pass'
)
},
},
{
{
path
:
'/os'
,
name
:
'os'
,
component
:
load
(
'os/List'
)
},
{
path
:
'/'
,
path
:
'/'
,
name
:
'index'
,
name
:
'index'
,
component
:
load
(
'Index'
)
component
:
load
(
'Index'
)
...
...
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