Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gateway-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
gateway-ui
Commits
75958a61
Commit
75958a61
authored
Dec 19, 2019
by
derong.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化部分列表
parent
af503111
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
238 additions
and
42 deletions
+238
-42
login.vue
src/components/login.vue
+10
-11
mainconfiguration.vue
src/pages/mainconfiguration/mainconfiguration.vue
+228
-31
No files found.
src/components/login.vue
View file @
75958a61
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
</Input>
</Input>
</FormItem>
</FormItem>
<FormItem
prop=
"password"
>
<FormItem
prop=
"password"
>
<Input
type=
"password"
v-model=
"loginForm.password"
placeholder=
"Password"
>
<Input
type=
"password"
v-model=
"loginForm.password"
placeholder=
"Password"
@
keyup.enter.native=
'login'
>
<Icon
type=
"ios-lock-outline"
slot=
"prepend"
></Icon>
<Icon
type=
"ios-lock-outline"
slot=
"prepend"
></Icon>
</Input>
</Input>
</FormItem>
</FormItem>
...
@@ -27,14 +27,13 @@ import {login} from '../api/user.api'
...
@@ -27,14 +27,13 @@ import {login} from '../api/user.api'
import
localStorage
from
'
../services/localStorage.service.js
'
import
localStorage
from
'
../services/localStorage.service.js
'
export
default
{
export
default
{
data
()
{
data
()
{
var
that
=
this
const
validateMenuClassifyId
=
(
rule
,
value
,
callback
)
=>
{
const
validateMenuClassifyId
=
(
rule
,
value
,
callback
)
=>
{
if
(
this
.
status
)
{
if
(
this
.
status
)
{
callback
(
new
Error
(
'
用户名或密码错误
'
))
callback
(
new
Error
(
'
用户名或密码错误
'
))
this
.
status
=
false
this
.
status
=
false
}
else
{
}
else
{
callback
()
callback
()
}
}
}
}
return
{
return
{
loginForm
:
{
loginForm
:
{
...
@@ -49,7 +48,7 @@ export default {
...
@@ -49,7 +48,7 @@ export default {
],
],
password
:
[
password
:
[
{
required
:
true
,
message
:
'
请输入密码
'
,
trigger
:
'
blur
'
},
{
required
:
true
,
message
:
'
请输入密码
'
,
trigger
:
'
blur
'
},
{
required
:
true
,
validator
:
validateMenuClassifyId
,
trigger
:
'
blur
'
}
{
required
:
true
,
validator
:
validateMenuClassifyId
,
trigger
:
'
blur
'
}
]
]
}
}
}
}
...
@@ -60,11 +59,11 @@ export default {
...
@@ -60,11 +59,11 @@ export default {
if
(
valid
)
{
if
(
valid
)
{
let
data
=
btoa
(
`
${
this
.
loginForm
.
loginName
}
:
${
this
.
loginForm
.
password
}
`
)
let
data
=
btoa
(
`
${
this
.
loginForm
.
loginName
}
:
${
this
.
loginForm
.
password
}
`
)
login
(
data
).
then
((
data
)
=>
{
login
(
data
).
then
((
data
)
=>
{
if
(
data
.
code
===
400
)
{
if
(
data
.
code
===
400
)
{
this
.
error
=
data
.
body
this
.
error
=
data
.
body
this
.
status
=
true
this
.
status
=
true
this
.
$refs
[
'
loginForm
'
].
validate
()
this
.
$refs
[
'
loginForm
'
].
validate
()
return
return
false
}
else
{
}
else
{
this
.
status
=
false
this
.
status
=
false
localStorage
.
set
(
'
heimdallr-token
'
,
data
.
body
[
'
heimdallr-token
'
])
localStorage
.
set
(
'
heimdallr-token
'
,
data
.
body
[
'
heimdallr-token
'
])
...
...
src/pages/mainconfiguration/mainconfiguration.vue
View file @
75958a61
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