Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
intel_promotion_manage
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
张伯涛
intel_promotion_manage
Commits
d156213a
Commit
d156213a
authored
Jul 05, 2024
by
张伯涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
密码加密
parent
3bc87d82
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
5 deletions
+23
-5
jsencrypt.js
src/utils/jsencrypt.js
+6
-1
reSetPsw.vue
src/views/reSetPsw.vue
+3
-2
index.vue
src/views/system/user/index.vue
+14
-2
No files found.
src/utils/jsencrypt.js
View file @
d156213a
...
...
@@ -16,7 +16,12 @@ export function encrypt(data) {
encryptor
.
setPublicKey
(
publicKey
)
return
encryptor
.
encrypt
(
json
)
}
export
function
encryptTwo
(
data
)
{
const
json
=
data
const
encryptor
=
new
JSEncrypt
()
encryptor
.
setPublicKey
(
publicKey
)
return
encryptor
.
encrypt
(
json
)
}
export
function
decrypt
(
txt
)
{
const
encryptor
=
new
JSEncrypt
()
encryptor
.
setPrivateKey
(
''
)
...
...
src/views/reSetPsw.vue
View file @
d156213a
...
...
@@ -46,6 +46,7 @@
</
template
>
<
script
>
import
{
updateUserPwd
}
from
'@/api/system/user.js'
import
{
encryptTwo
}
from
'@/utils/jsencrypt'
export
default
{
name
:
'ReSetPsw'
,
components
:
{},
...
...
@@ -82,8 +83,8 @@ export default {
this
.
$refs
[
'pwdForm'
].
validate
((
vaild
)
=>
{
if
(
vaild
)
{
const
params
=
{
oldPassword
:
this
.
pwdList
.
oldPass
,
newPassword
:
this
.
pwdList
.
pass
oldPassword
:
encryptTwo
(
this
.
pwdList
.
oldPass
)
,
newPassword
:
encryptTwo
(
this
.
pwdList
.
pass
)
}
updateUserPwd
(
params
).
then
(
res
=>
{
this
.
$message
.
success
(
'密码修改成功!'
)
...
...
src/views/system/user/index.vue
View file @
d156213a
...
...
@@ -406,6 +406,7 @@
</div>
</template>
<
script
>
import
{
encryptTwo
}
from
'@/utils/jsencrypt'
import
{
listUser
,
getUser
,
...
...
@@ -906,7 +907,7 @@ export default {
this
.
$refs
.
ruleForm
.
validate
(
pass
=>
{
if
(
pass
)
{
this
.
userRestLoading
=
true
resetUserPwd
(
this
.
ruleForm
.
row
,
this
.
ruleForm
.
newPassword
).
then
(
response
=>
{
resetUserPwd
(
this
.
ruleForm
.
row
,
encryptTwo
(
this
.
ruleForm
.
newPassword
)
).
then
(
response
=>
{
if
(
response
.
code
===
200
)
{
this
.
$message
({
message
:
'修改成功'
,
...
...
@@ -935,7 +936,18 @@ export default {
this
.
getList
()
})
}
else
{
addUser
(
this
.
form
).
then
(
response
=>
{
const
paramsAdd
=
{
identity
:
this
.
form
.
identity
,
username
:
this
.
form
.
username
,
flag
:
1
,
name
:
this
.
form
.
name
,
phone
:
this
.
form
.
phone
,
deptId
:
this
.
form
.
deptId
,
password
:
encryptTwo
(
this
.
form
.
password
),
roleList
:
this
.
form
.
roleList
,
remarks
:
this
.
form
.
remarks
}
addUser
(
paramsAdd
).
then
(
response
=>
{
this
.
newId
=
response
.
data
.
businessId
this
.
$message
({
message
:
'新增成功'
,
type
:
'success'
...
...
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