Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
work-order-web
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
张圳龙
work-order-web
Commits
7f77654c
Commit
7f77654c
authored
Aug 17, 2020
by
Mr. Lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ldap登陆校验。
parent
35e824d2
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
15 deletions
+25
-15
sysuser.js
src/api/system/sysuser.js
+3
-2
user.js
src/api/user.js
+2
-2
user.js
src/store/modules/user.js
+1
-5
index.vue
src/views/login/index.vue
+7
-2
resetPwd.vue
src/views/profile/resetPwd.vue
+12
-4
No files found.
src/api/system/sysuser.js
View file @
7f77654c
...
...
@@ -103,10 +103,11 @@ export function updateUserProfile(data) {
}
// 用户密码重置
export
function
updateUserPwd
(
oldPassword
,
newPassword
)
{
export
function
updateUserPwd
(
oldPassword
,
newPassword
,
passwordType
)
{
const
data
=
{
oldPassword
,
newPassword
newPassword
,
passwordType
}
return
request
({
url
:
'/api/v1/user/pwd'
,
...
...
src/api/user.js
View file @
7f77654c
import
request
from
'@/utils/request'
export
function
login
(
data
,
loginType
)
{
export
function
login
(
data
)
{
return
request
({
url
:
`/login
?login_type=
${
loginType
}
`
,
url
:
`/login`
,
method
:
'post'
,
data
})
...
...
src/store/modules/user.js
View file @
7f77654c
...
...
@@ -40,12 +40,8 @@ const mutations = {
const
actions
=
{
// user login
login
({
commit
},
userInfo
)
{
var
loginType
=
0
if
(
userInfo
.
loginType
===
true
)
{
loginType
=
1
}
return
new
Promise
((
resolve
,
reject
)
=>
{
login
(
userInfo
,
loginType
).
then
(
response
=>
{
login
(
userInfo
).
then
(
response
=>
{
const
{
token
}
=
response
commit
(
'SET_TOKEN'
,
token
)
setToken
(
token
)
...
...
src/views/login/index.vue
View file @
7f77654c
...
...
@@ -89,7 +89,7 @@
<img
style=
"height: 48px;width: 100%;border: 1px solid rgba(0,0,0, 0.1);border-radius:5px;"
:src=
"codeUrl"
@
click=
"getCode"
>
</div>
<div
prop=
"code"
style=
"width: 100%;float: left;margin-bottom: 13px"
>
<el-checkbox
v-model=
"login
Form.loginType
"
>
LDAP登陆
</el-checkbox>
<el-checkbox
v-model=
"login
TypeStatus
"
>
LDAP登陆
</el-checkbox>
</div>
<el-button
:loading=
"loading"
type=
"primary"
style=
"width:100%;padding:12px 20px;margin-bottom:30px;"
@
click
.
native
.
prevent=
"handleLogin"
>
<span
v-if=
"!loading"
>
登 录
</span>
...
...
@@ -122,6 +122,7 @@ export default {
components
:
{
SocialSign
},
data
()
{
return
{
loginTypeStatus
:
true
,
codeUrl
:
''
,
cookiePassword
:
''
,
loginForm
:
{
...
...
@@ -130,7 +131,7 @@ export default {
rememberMe
:
false
,
code
:
''
,
uuid
:
''
,
loginType
:
true
loginType
:
1
},
loginRules
:
{
username
:
[
...
...
@@ -221,6 +222,10 @@ export default {
handleLogin
()
{
this
.
$refs
.
loginForm
.
validate
(
valid
=>
{
if
(
valid
)
{
if
(
!
this
.
loginTypeStatus
)
{
this
.
loginForm
.
loginType
=
0
}
this
.
loading
=
true
this
.
$store
.
dispatch
(
'user/login'
,
this
.
loginForm
)
.
then
(()
=>
{
...
...
src/views/profile/resetPwd.vue
View file @
7f77654c
...
...
@@ -6,9 +6,12 @@
<el-form-item
label=
"新密码"
prop=
"newPassword"
>
<el-input
v-model=
"user.newPassword"
placeholder=
"请输入新密码"
type=
"password"
/>
</el-form-item>
<el-form-item
label=
"确认密码"
prop=
"confirmPassword"
>
<el-form-item
label=
"确认密码"
prop=
"confirmPassword"
style=
"/* margin-bottom: 10px */"
>
<el-input
v-model=
"user.confirmPassword"
placeholder=
"请确认密码"
type=
"password"
/>
</el-form-item>
<!--
<el-form-item
style=
"margin-bottom: 5px"
>
<el-checkbox
v-model=
"passwordTyleStatus"
>
LDAP密码
</el-checkbox>
</el-form-item>
-->
<el-form-item>
<el-button
type=
"primary"
size=
"mini"
@
click=
"submit"
>
保存
</el-button>
<el-button
type=
"danger"
size=
"mini"
@
click=
"close"
>
关闭
</el-button>
...
...
@@ -29,11 +32,12 @@ export default {
}
}
return
{
test
:
'1test'
,
passwordTyleStatus
:
true
,
user
:
{
oldPassword
:
undefined
,
newPassword
:
undefined
,
confirmPassword
:
undefined
confirmPassword
:
undefined
,
passwordType
:
1
},
// 表单校验
rules
:
{
...
...
@@ -55,7 +59,11 @@ export default {
submit
()
{
this
.
$refs
[
'form'
].
validate
(
valid
=>
{
if
(
valid
)
{
updateUserPwd
(
this
.
user
.
oldPassword
,
this
.
user
.
newPassword
).
then
(
if
(
!
this
.
passwordTyleStatus
)
{
this
.
user
.
passwordType
=
0
}
this
.
user
.
passwordType
=
0
updateUserPwd
(
this
.
user
.
oldPassword
,
this
.
user
.
newPassword
,
this
.
user
.
passwordType
).
then
(
response
=>
{
if
(
response
.
code
===
200
)
{
this
.
msgSuccess
(
'修改成功'
)
...
...
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