Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
liuzhen@situdata.com
/
yunxiao-admin-fe
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
8b2ae993
authored
2020-12-17 15:48:58 +0800
by
zhen
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:登录使用AES加密
1 parent
88207ae8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
src/utils/aes.js
src/views/login/index.vue
src/utils/aes.js
View file @
8b2ae99
...
...
@@ -5,7 +5,7 @@ const AES_KEY = '94a80df2633b4944'
export
function
aesEncode
(
str
)
{
const
key
=
CryptoJS
.
enc
.
Utf8
.
parse
(
AES_KEY
)
const
word
=
CryptoJS
.
enc
.
Utf8
.
parse
(
str
)
debugger
const
encrypted
=
CryptoJS
.
AES
.
encrypt
(
word
,
key
,
{
mode
:
CryptoJS
.
mode
.
ECB
,
padding
:
CryptoJS
.
pad
.
Pkcs7
...
...
src/views/login/index.vue
View file @
8b2ae99
...
...
@@ -33,8 +33,8 @@ export default {
async
handleLogin
({
username
,
password
})
{
try
{
this
.
btnLoading
=
true
//
const passPhrase = aesEncode(password)
const
{
code
}
=
await
this
.
login
({
username
,
password
})
const
passPhrase
=
aesEncode
(
password
)
const
{
code
}
=
await
this
.
login
({
username
,
password
:
passPhrase
})
if
(
code
===
0
)
{
this
.
$router
.
push
({
path
:
'/'
})
}
else
{
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment