Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mr-julyedu
Overview
Overview
Details
Activity
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
baiguangyao
mr-julyedu
Commits
16b1be75
Commit
16b1be75
authored
Jun 06, 2019
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
encryption
parent
0a423a3c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
src/components/passport/accountLogin/index.js
+7
-0
src/components/passport/encryption/index.js
+5
-3
No files found.
src/components/passport/accountLogin/index.js
View file @
16b1be75
...
...
@@ -10,10 +10,17 @@ import LoginButton from '../common/LoginButton'
import
PasswordInput
from
'../common/passwordInput'
// import VeriCodeButton from '../common/veriCodeInput'
// import LoginWays from '../common/LoginWays'
import
{
encrypt
,
decrypt
}
from
'@/components/passport/encryption'
;
class
AccountLogin
extends
Component
{
componentDidMount
()
{
}
render
()
{
return
(
<
div
className
=
{
'account-login'
}
>
...
...
src/components/passport/encryption/index.js
View file @
16b1be75
import
aes
from
'crypto-js/aes'
import
Crypto
from
'crypto-js'
const
PASSPHRASE
=
'7BFF85920AA7D7FB6664E0EAEB45494E589CDE45589340DAEB2F837CFB7B843B066ECCA888D883BA6F0A08DFDC9BCAD5ACBFFFE03CF8A797025EA7FE54A07473A305BFFB7FDFEA1AED1070BB753C65EF6379711BE2BC1742CFC88C487BDDBEE4CEF34117C23DB8E9CBC6854A150756935302EDE68D224956994F5046DA623ECC'
const
key
=
'C7D590D00FA968A261BDD5B6CD40DDC2C0561338BF8B9197'
const
iv
=
'19513F90B7A8875E469E82195F90EE99'
function
encrypt
(
message
)
{
return
aes
.
encrypt
(
message
,
PASSPHRASE
).
toString
()
return
aes
.
encrypt
(
message
,
key
,
{
iv
}
).
toString
()
}
function
decrypt
(
encrypted
)
{
return
Crypto
.
enc
.
Utf8
.
stringify
(
aes
.
decrypt
(
encrypted
,
PASSPHRASE
))
return
Crypto
.
enc
.
Utf8
.
stringify
(
aes
.
decrypt
(
encrypted
,
key
,
{
iv
}
))
}
export
{
encrypt
,
decrypt
}
\ No newline at end of file
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