Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
ae2ccee4
"src/main/webapp/vscode:/vscode.git/clone" did not exist on "27867d4e8be822c4598dbda24cdada20b5c1e711"
Commit
ae2ccee4
authored
Nov 02, 2018
by
Junling Bu
Browse files
feat[litemall-admin]: 登录页面和管理员页面显示后端报错信息。
parent
4ca3da28
Changes
2
Hide whitespace changes
Inline
Side-by-side
litemall-admin/src/views/login/index.vue
View file @
ae2ccee4
...
@@ -73,7 +73,11 @@ export default {
...
@@ -73,7 +73,11 @@ export default {
this
.
$store
.
dispatch
(
'
LoginByUsername
'
,
this
.
loginForm
).
then
(()
=>
{
this
.
$store
.
dispatch
(
'
LoginByUsername
'
,
this
.
loginForm
).
then
(()
=>
{
this
.
loading
=
false
this
.
loading
=
false
this
.
$router
.
push
({
path
:
'
/
'
})
this
.
$router
.
push
({
path
:
'
/
'
})
}).
catch
(()
=>
{
}).
catch
(
response
=>
{
this
.
$notify
.
error
({
title
:
'
失败
'
,
message
:
response
.
data
.
errmsg
})
this
.
loading
=
false
this
.
loading
=
false
})
})
}
else
{
}
else
{
...
...
litemall-admin/src/views/sys/admin.vue
View file @
ae2ccee4
...
@@ -48,9 +48,6 @@
...
@@ -48,9 +48,6 @@
<el-form-item
label=
"管理员密码"
prop=
"password"
>
<el-form-item
label=
"管理员密码"
prop=
"password"
>
<el-input
type=
"password"
v-model=
"dataForm.password"
auto-complete=
"off"
></el-input>
<el-input
type=
"password"
v-model=
"dataForm.password"
auto-complete=
"off"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"确认密码"
prop=
"checkPassword"
>
<el-input
type=
"password"
v-model=
"dataForm.checkPassword"
auto-complete=
"off"
></el-input>
</el-form-item>
<el-form-item
label=
"管理员头像"
prop=
"avatar"
>
<el-form-item
label=
"管理员头像"
prop=
"avatar"
>
<el-upload
class=
"avatar-uploader"
:headers=
"headers"
:action=
"uploadPath"
list-type=
"picture-card"
:show-file-list=
"false"
accept=
".jpg,.jpeg,.png,.gif"
:on-success=
"uploadAvatar"
>
<el-upload
class=
"avatar-uploader"
:headers=
"headers"
:action=
"uploadPath"
list-type=
"picture-card"
:show-file-list=
"false"
accept=
".jpg,.jpeg,.png,.gif"
:on-success=
"uploadAvatar"
>
<img
v-if=
"dataForm.avatar"
:src=
"dataForm.avatar"
class=
"avatar"
>
<img
v-if=
"dataForm.avatar"
:src=
"dataForm.avatar"
class=
"avatar"
>
...
@@ -109,25 +106,6 @@ export default {
...
@@ -109,25 +106,6 @@ export default {
}
}
},
},
data
()
{
data
()
{
var
validatePass
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
===
''
)
{
callback
(
new
Error
(
'
请输入密码
'
))
}
else
{
if
(
this
.
dataForm
.
checkPassword
!==
''
)
{
this
.
$refs
.
dataForm
.
validateField
(
'
checkPassword
'
)
}
callback
()
}
}
var
validatePass2
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
===
''
)
{
callback
(
new
Error
(
'
请再次输入密码
'
))
}
else
if
(
value
!==
this
.
dataForm
.
password
)
{
callback
(
new
Error
(
'
两次输入密码不一致!
'
))
}
else
{
callback
()
}
}
return
{
return
{
uploadPath
,
uploadPath
,
list
:
null
,
list
:
null
,
...
@@ -144,7 +122,6 @@ export default {
...
@@ -144,7 +122,6 @@ export default {
id
:
undefined
,
id
:
undefined
,
username
:
undefined
,
username
:
undefined
,
password
:
undefined
,
password
:
undefined
,
checkPassword
:
undefined
,
avatar
:
undefined
avatar
:
undefined
},
},
dialogFormVisible
:
false
,
dialogFormVisible
:
false
,
...
@@ -155,14 +132,7 @@ export default {
...
@@ -155,14 +132,7 @@ export default {
},
},
rules
:
{
rules
:
{
username
:
[{
required
:
true
,
message
:
'
管理员名称不能为空
'
,
trigger
:
'
blur
'
}],
username
:
[{
required
:
true
,
message
:
'
管理员名称不能为空
'
,
trigger
:
'
blur
'
}],
password
:
[
password
:
[{
required
:
true
,
message
:
'
密码不能为空
'
,
trigger
:
'
blur
'
}]
{
required
:
true
,
message
:
'
密码不能为空
'
,
trigger
:
'
blur
'
},
{
validator
:
validatePass
,
trigger
:
'
blur
'
}
],
checkPassword
:
[
{
required
:
true
,
message
:
'
密码不能为空
'
,
trigger
:
'
blur
'
},
{
validator
:
validatePass2
,
trigger
:
'
blur
'
}
]
},
},
downloadLoading
:
false
downloadLoading
:
false
}
}
...
@@ -200,7 +170,6 @@ export default {
...
@@ -200,7 +170,6 @@ export default {
id
:
undefined
,
id
:
undefined
,
username
:
undefined
,
username
:
undefined
,
password
:
undefined
,
password
:
undefined
,
checkPassword
:
undefined
,
avatar
:
undefined
avatar
:
undefined
}
}
},
},
...
@@ -224,11 +193,11 @@ export default {
...
@@ -224,11 +193,11 @@ export default {
this
.
$notify
.
success
({
this
.
$notify
.
success
({
title
:
'
成功
'
,
title
:
'
成功
'
,
message
:
'
添加管理员成功
'
message
:
'
添加管理员成功
'
})
.
catch
(
response
=>
{
})
this
.
$notify
.
error
(
{
}).
catch
(
response
=>
{
title
:
'
失败
'
,
this
.
$notify
.
error
({
message
:
response
.
data
.
errmsg
title
:
'
失败
'
,
})
message
:
response
.
data
.
errmsg
})
})
})
})
}
}
...
...
Write
Preview
Supports
Markdown
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