Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
portalhtml
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
rex
portalhtml
Commits
618fc58a
Commit
618fc58a
authored
Oct 15, 2021
by
jiangqihao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首次登入修改密码
parent
b8b7f243
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
211 additions
and
46 deletions
+211
-46
account.js
src/api/account.js
+1
-1
user.js
src/store/modules/user.js
+2
-3
index.vue
src/views/login/index.vue
+208
-42
No files found.
src/api/account.js
View file @
618fc58a
...
@@ -3,7 +3,7 @@ export const employee = {
...
@@ -3,7 +3,7 @@ export const employee = {
createUrl
:
'/employee/create'
,
createUrl
:
'/employee/create'
,
searchUrl
:
'/employee/search'
,
searchUrl
:
'/employee/search'
,
detailUrl
:
'/employee/getOne'
,
detailUrl
:
'/employee/getOne'
,
updateUrl
:
'/
employee/update
'
,
updateUrl
:
'/
updatePassword
'
,
confirmUpdateUrl
:
'/employee/confirmUpdate'
,
confirmUpdateUrl
:
'/employee/confirmUpdate'
,
cancelUpdateUrl
:
'/employee/cancelUpdate'
cancelUpdateUrl
:
'/employee/cancelUpdate'
}
}
...
...
src/store/modules/user.js
View file @
618fc58a
...
@@ -38,9 +38,8 @@ const actions = {
...
@@ -38,9 +38,8 @@ const actions = {
data
.
roles
=
[
'admin'
]
data
.
roles
=
[
'admin'
]
data
.
avatar
=
'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif'
data
.
avatar
=
'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif'
commit
(
'SET_TOKEN'
,
data
.
ObjectID
)
commit
(
'SET_TOKEN'
,
data
.
ObjectID
)
if
(
data
.
ExtIsFistTime_SDK
)
{
localStorage
.
setItem
(
'CEINFO'
,
JSON
.
stringify
(
data
))
localStorage
.
setItem
(
'CEINFO'
,
JSON
.
stringify
(
data
))
}
else
{
if
(
!
data
.
ExtIsFistTime_SDK
)
{
localStorage
.
setItem
(
'USERINFO'
,
JSON
.
stringify
(
data
))
localStorage
.
setItem
(
'USERINFO'
,
JSON
.
stringify
(
data
))
}
}
setToken
(
data
.
ObjectID
)
setToken
(
data
.
ObjectID
)
...
...
src/views/login/index.vue
View file @
618fc58a
...
@@ -80,8 +80,34 @@
...
@@ -80,8 +80,34 @@
<!--
<p>
创新服务全民
</p>
<!--
<p>
创新服务全民
</p>
</div>
-->
</div>
-->
<el-dialog
:visible
.
sync=
"updatePassword"
>
<el-dialog
:visible
.
sync=
"updatePassword"
width=
'40%'
:close-on-click-modal=
"clickModel"
:close-on-press-escape=
"clickModel"
:show-close=
"clickModel"
>
<div
class=
"changePass"
>
<div
class=
"title-container"
>
<img
src=
"../../assets/images/login_top.png"
>
<h3
class=
"title"
>
修改初始密码
</h3>
</div>
<div
>
<ele-form
ref=
"form"
v-bind=
"formConfig"
v-model=
"formData"
/>
</div>
<div
class=
"submit-btn"
>
<el-button
:loading=
"loading"
type=
"primary"
icon=
"el-icon-check"
@
click=
"handleNext"
>
确定
</el-button>
</div>
</div>
</el-dialog>
</el-dialog>
</div>
</div>
</
template
>
</
template
>
...
@@ -90,12 +116,22 @@
...
@@ -90,12 +116,22 @@
// import { validUsername } from '@/utils/validate'
// import { validUsername } from '@/utils/validate'
// import LangSelect from '@/components/LangSelect'
// import LangSelect from '@/components/LangSelect'
// import SocialSign from './components/SocialSignin'
// import SocialSign from './components/SocialSignin'
import
path
from
'path'
;
// import path from 'path';
import
{
update
}
from
'@/api/flow/flow-definition'
;
// import { update } from '@/api/flow/flow-definition';
// import changePassword from '@/views/changePass/index'
import
Title
from
'@/components/Title'
import
EleTable
from
'@/components/EleTable/EleTable.vue'
import
{
employee
}
from
'@/api/account'
export
default
{
export
default
{
name
:
'Login'
,
name
:
'Login'
,
// components: { LangSelect, SocialSign },
// components: { LangSelect, SocialSign },
components
:
{
// changePassword,
Title
,
EleTable
},
data
()
{
data
()
{
const
validateUsername
=
(
rule
,
value
,
callback
)
=>
{
const
validateUsername
=
(
rule
,
value
,
callback
)
=>
{
if
(
!
value
)
{
if
(
!
value
)
{
...
@@ -112,6 +148,7 @@ export default {
...
@@ -112,6 +148,7 @@ export default {
}
}
}
}
return
{
return
{
clickModel
:
false
,
loginForm
:
{
loginForm
:
{
username
:
''
,
username
:
''
,
password
:
''
password
:
''
...
@@ -126,7 +163,69 @@ export default {
...
@@ -126,7 +163,69 @@ export default {
showDialog
:
false
,
showDialog
:
false
,
redirect
:
undefined
,
redirect
:
undefined
,
otherQuery
:
{},
otherQuery
:
{},
updatePassword
:
false
updatePassword
:
false
,
formData
:
{},
formConfig
:
{
isDialog
:
true
,
isShowBackBtn
:
false
,
isShowSubmitBtn
:
false
,
isShowCancelBtn
:
false
,
formDesc
:
{
OldPassword
:
{
type
:
"input"
,
label
:
"原始密码"
,
layout
:
14
,
required
:
true
,
rules
:
[
{
trigger
:
"blur"
,
message
:
"请输入原始密码"
}
],
attrs
:
{
size
:
"mini"
,
clearable
:
false
}
},
NewPassword
:
{
type
:
"input"
,
label
:
"新密码"
,
layout
:
14
,
required
:
true
,
rules
:
[
{
trigger
:
"blur"
,
message
:
"请输入新密码"
}
],
attrs
:
{
size
:
"mini"
,
clearable
:
false
}
},
AgainPassword
:
{
type
:
"input"
,
label
:
"确认密码"
,
layout
:
14
,
required
:
true
,
rules
:
[
{
trigger
:
"blur"
,
message
:
"请输入新密码"
}
],
attrs
:
{
size
:
"mini"
,
clearable
:
false
}
}
},
order
:
[
"OldPassword"
,
"NewPassword"
,
"AgainPassword"
]
}
}
}
},
},
watch
:
{
watch
:
{
...
@@ -143,6 +242,7 @@ export default {
...
@@ -143,6 +242,7 @@ export default {
},
},
created
()
{
created
()
{
localStorage
.
removeItem
(
'USERINFO'
)
localStorage
.
removeItem
(
'USERINFO'
)
this
.
userInfo
=
JSON
.
parse
(
localStorage
.
getItem
(
'CEINFO'
))
// window.addEventListener('storage', this.afterQRScan)
// window.addEventListener('storage', this.afterQRScan)
},
},
mounted
()
{
mounted
()
{
...
@@ -180,22 +280,22 @@ export default {
...
@@ -180,22 +280,22 @@ export default {
}
}
this
.
$store
.
dispatch
(
'user/login'
,
params
)
this
.
$store
.
dispatch
(
'user/login'
,
params
)
.
then
(()
=>
{
.
then
(()
=>
{
// if (JSON.parse(localStorage.getItem('CEINFO')).ExtIsFistTime_SDK) {
const
start
=
JSON
.
parse
(
localStorage
.
getItem
(
'CEINFO'
)).
ExtIsFistTime_SDK
?
true
:
false
// this.$confirm('首次登入请修改密码', '提示', {
console
.
log
(
start
)
// confirmButtonText: '确定',
if
(
start
)
{
// type: 'warning'
this
.
$confirm
(
'首次登入请修改密码'
,
'提示'
,
{
// }).then(() => {
confirmButtonText
:
'确定'
,
// let dataInfo = JSON.parse(localStorage.getItem('CEINFO'))
showClose
:
false
,
// localStorage.setItem('USERINFO', JSON.stringify(dataInfo))
showCancelButton
:
false
,
// localStorage.setItem('CEINFO', '')
type
:
'warning'
// this.$router.push({ path: '/changePass' , query: this.otherQuery })
}).
then
(()
=>
{
// }).catch(() => {
this
.
updatePassword
=
true
// console.log('登入失败')
this
.
loading
=
false
// });
})
//
} else {
}
else
{
this
.
$router
.
push
({
path
:
this
.
redirect
||
'/'
,
query
:
this
.
otherQuery
})
this
.
$router
.
push
({
path
:
this
.
redirect
||
'/'
,
query
:
this
.
otherQuery
})
// }
this
.
loading
=
false
this
.
loading
=
false
}
})
})
.
catch
(()
=>
{
.
catch
(()
=>
{
this
.
loading
=
false
this
.
loading
=
false
...
@@ -214,25 +314,49 @@ export default {
...
@@ -214,25 +314,49 @@ export default {
}
}
return
acc
return
acc
},
{})
},
{})
},
async
handleNext
()
{
await
this
.
$refs
.
form
.
validate
()
this
.
loading
=
true
if
(
this
.
$refs
.
form
.
$refs
.
NewPassword
[
0
].
value
===
this
.
$refs
.
form
.
$refs
.
AgainPassword
[
0
].
value
)
{
const
formData
=
this
.
formData
formData
.
ObjectID
=
this
.
userInfo
.
ObjectID
console
.
log
(
formData
)
const
formNewData
=
{
objectID
:
formData
.
ObjectID
,
extPassword_SDK
:
formData
.
OldPassword
,
newPassword
:
formData
.
NewPassword
}
this
.
$request
(
employee
.
updateUrl
,
formNewData
).
then
(()
=>
{
localStorage
.
setItem
(
'USERINFO'
,
JSON
.
stringify
(
this
.
userInfo
))
localStorage
.
removeItem
(
'CEINFO'
)
// console.log("登入成功")
this
.
loading
=
false
this
.
updatePassword
=
false
this
.
$router
.
push
({
path
:
this
.
redirect
||
'/'
,
query
:
this
.
otherQuery
})
})
}
else
{
this
.
$message
.
error
(
'确认密码出错!!'
)
}
},
updateBaseInfo
()
{
const
formData
=
this
.
formData
this
.
formData
.
ObjectID
=
this
.
userInfo
.
ObjectID
console
.
log
(
333333333
,
this
.
formData
)
// this.$getUpdateChange(JSON.parse(this.formDataOldStr), this.formData)
if
(
Object
.
keys
(
formData
).
length
>
1
)
{
this
.
loading
=
true
this
.
$request
(
employee
.
updateUrl
,
formData
).
then
(()
=>
{
this
.
loading
=
false
this
.
$message
.
success
(
'更新成功!'
)
})
}
else
{
this
.
$message
.
error
(
'sorry'
)
}
}
}
// afterQRScan() {
// if (e.key === 'x-admin-oauth-code') {
// const code = getQueryObject(e.newValue)
// const codeMap = {
// wechat: 'code',
// tencent: 'code'
// }
// const type = codeMap[this.auth_type]
// const codeName = code[type]
// if (codeName) {
// this.$store.dispatch('LoginByThirdparty', codeName).then(() => {
// this.$router.push({ path: this.redirect || '/' })
// })
// } else {
// alert('第三方登录失败')
// }
// }
// }
}
}
}
}
</
script
>
</
script
>
...
@@ -249,23 +373,36 @@ export default {
...
@@ -249,23 +373,36 @@ export default {
display
:
inline-block
;
display
:
inline-block
;
height
:
47px
;
height
:
47px
;
width
:
85%
;
width
:
85%
;
input
{
input
{
border
:
0px
;
border
:
0px
;
border-radius
:
0px
;
padding
:
12px
5px
12px
15px
;
padding
:
12px
5px
12px
15px
;
color
:
#999
;
color
:
#999
;
height
:
47px
;
height
:
47px
;
font-size
:
14px
;
font-size
:
14px
;
}
}
}
}
.el-form-item
{
.el-form-item
{
border
:
1px
solid
#ccc
;
border
:
1px
solid
#ccc
;
border-radius
:
5px
;
border-radius
:
5px
;
color
:
#454545
;
color
:
#454545
;
margin-bottom
:
30px
;
margin-bottom
:
30px
;
}
}
.changePass
{
.el-form-item
{
border
:
none
;
display
:
flex
;
.el-form-item__content
{
border
:
1px
solid
#454545
;
border-radius
:
5px
;
}
.ele-form-btns
{
border
:
none
!
important
;
}
}
.el-form-item__label
{
width
:
90px
;
}
}
}
}
</
style
>
</
style
>
...
@@ -326,7 +463,7 @@ $dark_gray:#889aa4;
...
@@ -326,7 +463,7 @@ $dark_gray:#889aa4;
.title-container
{
.title-container
{
position
:
relative
;
position
:
relative
;
margin
:
50px
auto
;
margin
:
0px
auto
50px
!
important
;
img
{
img
{
width
:
50%
;
width
:
50%
;
margin-left
:
25%
;
margin-left
:
25%
;
...
@@ -357,4 +494,33 @@ $dark_gray:#889aa4;
...
@@ -357,4 +494,33 @@ $dark_gray:#889aa4;
user-select
:
none
;
user-select
:
none
;
}
}
}
}
.submit-btn
{
.el-button
{
height
:
40px
;
width
:
300px
;
}
}
.el-dialog__body
{
padding
:
0px
20px
;
}
.changePass
{
::v-deep
.el-row
{
display
:
flex
;
flex-flow
:
wrap
;
justify-content
:
center
;
}
::v-deep
.el-form-item
{
margin-bottom
:
20px
;
}
::v-deep
.el-form-item__content
{
width
:
220px
;
height
:
32px
;
.el-input
{
height
:
32px
;
.el-input__inner
{
height
:
28px
;
}
}
}
}
</
style
>
</
style
>
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