Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tea-resources-web
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
张伯涛
tea-resources-web
Commits
82b559a2
Commit
82b559a2
authored
Jul 01, 2024
by
张伯涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加密问题区分对象加密和单个字段加密
parent
3838ac17
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
8 deletions
+13
-8
jsencrypt.js
src/utils/jsencrypt.js
+6
-1
login.vue
src/views/login/login.vue
+1
-1
reSetPsw.vue
src/views/reSetPsw.vue
+3
-3
index.vue
src/views/system/user/index.vue
+3
-3
No files found.
src/utils/jsencrypt.js
View file @
82b559a2
...
@@ -16,7 +16,12 @@ export function encrypt(data) {
...
@@ -16,7 +16,12 @@ export function encrypt(data) {
encryptor
.
setPublicKey
(
publicKey
)
encryptor
.
setPublicKey
(
publicKey
)
return
encryptor
.
encrypt
(
json
)
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
)
{
export
function
decrypt
(
txt
)
{
const
encryptor
=
new
JSEncrypt
()
const
encryptor
=
new
JSEncrypt
()
encryptor
.
setPrivateKey
(
''
)
encryptor
.
setPrivateKey
(
''
)
...
...
src/views/login/login.vue
View file @
82b559a2
...
@@ -251,7 +251,7 @@ export default {
...
@@ -251,7 +251,7 @@ export default {
this
.
$router
.
push
(
'/controlPlatform/control'
)
this
.
$router
.
push
(
'/controlPlatform/control'
)
}).
catch
(()
=>
{
}).
catch
(()
=>
{
this
.
loading
=
false
this
.
loading
=
false
this
.
verify
=
fals
e
this
.
verify
=
tru
e
if
(
this
.
captchaType
===
'MATH'
||
this
.
captchaType
===
'CHAR'
)
{
if
(
this
.
captchaType
===
'MATH'
||
this
.
captchaType
===
'CHAR'
)
{
this
.
getCode
()
this
.
getCode
()
}
}
...
...
src/views/reSetPsw.vue
View file @
82b559a2
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
updateUserPwd
}
from
'@/api/system/user.js'
import
{
updateUserPwd
}
from
'@/api/system/user.js'
import
{
encrypt
}
from
'@/utils/jsencrypt'
import
{
encrypt
Two
}
from
'@/utils/jsencrypt'
export
default
{
export
default
{
name
:
'ReSetPsw'
,
name
:
'ReSetPsw'
,
components
:
{},
components
:
{},
...
@@ -106,8 +106,8 @@ export default {
...
@@ -106,8 +106,8 @@ export default {
this
.
$refs
[
'pwdForm'
].
validate
((
vaild
)
=>
{
this
.
$refs
[
'pwdForm'
].
validate
((
vaild
)
=>
{
if
(
vaild
)
{
if
(
vaild
)
{
const
params
=
{
const
params
=
{
oldPassword
:
encrypt
(
this
.
pwdList
.
oldPass
),
oldPassword
:
encrypt
Two
(
this
.
pwdList
.
oldPass
),
newPassword
:
encrypt
(
this
.
pwdList
.
pass
)
newPassword
:
encrypt
Two
(
this
.
pwdList
.
pass
)
}
}
updateUserPwd
(
params
).
then
(
res
=>
{
updateUserPwd
(
params
).
then
(
res
=>
{
this
.
$message
.
success
(
'密码修改成功!'
)
this
.
$message
.
success
(
'密码修改成功!'
)
...
...
src/views/system/user/index.vue
View file @
82b559a2
...
@@ -395,7 +395,7 @@
...
@@ -395,7 +395,7 @@
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
{
encrypt
}
from
'@/utils/jsencrypt'
import
{
encrypt
Two
}
from
'@/utils/jsencrypt'
import
{
import
{
listUser
,
listUser
,
getUser
,
getUser
,
...
@@ -849,7 +849,7 @@ export default {
...
@@ -849,7 +849,7 @@ export default {
this
.
$refs
.
ruleForm
.
validate
(
pass
=>
{
this
.
$refs
.
ruleForm
.
validate
(
pass
=>
{
if
(
pass
)
{
if
(
pass
)
{
this
.
userRestLoading
=
true
this
.
userRestLoading
=
true
resetUserPwd
(
this
.
ruleForm
.
row
,
encrypt
(
this
.
ruleForm
.
newPassword
)).
then
(
response
=>
{
resetUserPwd
(
this
.
ruleForm
.
row
,
encrypt
Two
(
this
.
ruleForm
.
newPassword
)).
then
(
response
=>
{
if
(
response
.
code
===
200
)
{
if
(
response
.
code
===
200
)
{
this
.
$message
({
this
.
$message
({
message
:
'修改成功'
,
message
:
'修改成功'
,
...
@@ -894,7 +894,7 @@ export default {
...
@@ -894,7 +894,7 @@ export default {
flag
:
1
,
flag
:
1
,
name
:
this
.
form
.
name
,
name
:
this
.
form
.
name
,
phone
:
this
.
form
.
phone
,
phone
:
this
.
form
.
phone
,
password
:
encrypt
(
this
.
form
.
password
),
password
:
encrypt
Two
(
this
.
form
.
password
),
roleList
:
this
.
form
.
roleList
,
roleList
:
this
.
form
.
roleList
,
remarks
:
this
.
form
.
remarks
remarks
:
this
.
form
.
remarks
}
}
...
...
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