Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
9
91isoft_vue_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
杨硕
91isoft_vue_manage
Commits
99541d74
Commit
99541d74
authored
Jan 09, 2024
by
张毅辰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录修改(验证码&加密)
parent
df298467
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
423 additions
and
62 deletions
+423
-62
login.js
src/api/login.js
+6
-4
sprite.1.5.8.png
src/assets/image/sprite.1.5.8.png
+0
-0
Verify.vue
src/components/Verifition/Verify.vue
+1
-1
VerifyPoints.vue
src/components/Verifition/Verify/VerifyPoints.vue
+18
-15
VerifySlide.vue
src/components/Verifition/Verify/VerifySlide.vue
+20
-21
index.js
src/components/Verifition/api/index.js
+0
-2
login.vue
src/views/login/login.vue
+378
-19
No files found.
src/api/login.js
View file @
99541d74
...
...
@@ -63,18 +63,20 @@ export function captchaImage() {
}
// 获取验证图片
export
function
reqGet
(
data
)
{
export
function
getBwCaptcha
(
params
)
{
const
data
=
Qs
.
stringify
(
params
)
return
request
({
url
:
'/captcha/get'
,
url
:
'/captcha/get
BwCaptcha
'
,
method
:
'post'
,
data
})
}
// 滑动或者点选验证
export
function
reqCheck
(
data
)
{
export
function
checkBwCaptcha
(
params
)
{
const
data
=
Qs
.
stringify
(
params
)
return
request
({
url
:
'/captcha/check'
,
url
:
'/captcha/check
BwCaptcha
'
,
method
:
'post'
,
data
})
...
...
src/assets/image/sprite.1.5.8.png
0 → 100644
View file @
99541d74
3.35 KB
src/components/Verifition/Verify.vue
View file @
99541d74
...
...
@@ -18,7 +18,7 @@
<components
:is=
"componentType"
v-if=
"componentType"
:captcha-type=
"c
aptcha
Type"
:captcha-type=
"c
omponent
Type"
:type=
"verifyType"
ref=
"instance"
:figure=
"figure"
...
...
src/components/Verifition/Verify/VerifyPoints.vue
View file @
99541d74
...
...
@@ -78,7 +78,7 @@ import {
_code_color2
}
from
'./../utils/util'
import
{
aesEncrypt
}
from
'./../utils/ase'
import
{
reqGet
,
reqCheck
}
from
'@/api/login'
import
{
getBwCaptcha
,
checkBwCaptcha
}
from
'@/api/login'
export
default
{
name
:
'VerifyPoints'
,
...
...
@@ -203,13 +203,14 @@ export default {
console
.
log
(
'token'
,
this
.
backToken
)
console
.
log
(
'大概是滑动数据(加密后 pointJson)'
,
this
.
checkPosArr
)
console
.
log
(
'加密前JSON'
,
JSON
.
stringify
(
this
.
checkPosArr
))
reqCheck
(
data
).
then
((
res
)
=>
{
if
(
res
.
repCode
==
'0000'
)
{
checkBwCaptcha
(
data
).
then
((
res
)
=>
{
const
{
data
}
=
res
if
(
data
.
repCode
===
'0000'
)
{
this
.
barAreaColor
=
'#4cae4c'
this
.
barAreaBorderColor
=
'#5cb85c'
this
.
text
=
'验证成功'
this
.
bindingClick
=
false
if
(
this
.
mode
==
'pop'
)
{
if
(
this
.
mode
==
=
'pop'
)
{
setTimeout
(()
=>
{
this
.
$parent
.
clickShow
=
false
this
.
refresh
()
...
...
@@ -264,21 +265,23 @@ export default {
clientUid
:
localStorage
.
getItem
(
'point'
),
ts
:
Date
.
now
()
// 现在的时间戳
}
reqGet
(
data
).
then
((
res
)
=>
{
if
(
res
.
repCode
==
'0000'
)
{
this
.
pointBackImgBase
=
res
.
repData
.
originalImageBase64
this
.
backToken
=
res
.
repData
.
token
this
.
secretKey
=
res
.
repData
.
secretKey
this
.
poinTextList
=
res
.
repData
.
wordList
getBwCaptcha
(
data
).
then
(
res
=>
{
const
{
data
,
code
}
=
res
if
(
data
.
repCode
===
'0000'
)
{
this
.
pointBackImgBase
=
data
.
repData
.
originalImageBase64
this
.
backToken
=
data
.
repData
.
token
this
.
secretKey
=
data
.
repData
.
secretKey
this
.
poinTextList
=
data
.
repData
.
wordList
this
.
text
=
'请依次点击【'
+
this
.
poinTextList
.
join
(
','
)
+
'】'
}
else
{
this
.
text
=
res
.
repMsg
this
.
text
=
data
.
repMsg
}
if
(
code
===
400
)
{
// 判断接口请求次数是否失效
if
(
res
.
repCode
==
'6201'
)
{
if
(
data
.
repCode
=
==
'6201'
)
{
this
.
pointBackImgBase
=
null
}
}
})
},
// 坐标转换函数
...
...
src/components/Verifition/Verify/VerifySlide.vue
View file @
99541d74
...
...
@@ -93,7 +93,7 @@
* */
import
{
aesEncrypt
}
from
'./../utils/ase'
import
{
resetSize
}
from
'./../utils/util'
import
{
reqGet
,
reqCheck
}
from
'@/api/login'
import
{
getBwCaptcha
,
checkBwCaptcha
}
from
'@/api/login'
// "captchaType":"blockPuzzle",
export
default
{
...
...
@@ -327,13 +327,9 @@ export default {
pointJson
:
this
.
secretKey
?
aesEncrypt
(
JSON
.
stringify
({
x
:
moveLeftDistance
,
y
:
5.0
}),
this
.
secretKey
)
:
JSON
.
stringify
({
x
:
moveLeftDistance
,
y
:
5.0
}),
token
:
this
.
backToken
}
console
.
log
(
'captchaType'
,
this
.
captchaType
)
console
.
log
(
'secretKey'
,
this
.
secretKey
)
console
.
log
(
'token'
,
this
.
backToken
)
console
.
log
(
'坐标(滑动不存在Y)'
,
moveLeftDistance
)
console
.
log
(
'加密前JSON'
,
JSON
.
stringify
({
x
:
moveLeftDistance
,
y
:
5.0
}))
reqCheck
(
data
).
then
((
res
)
=>
{
if
(
res
.
repCode
==
'0000'
)
{
checkBwCaptcha
(
data
).
then
((
res
)
=>
{
const
{
data
}
=
res
if
(
data
.
repCode
===
'0000'
)
{
this
.
moveBlockBackgroundColor
=
'#5cb85c'
this
.
leftBarBorderColor
=
'#5cb85c'
this
.
iconColor
=
'#fff'
...
...
@@ -358,7 +354,6 @@ export default {
setTimeout
(()
=>
{
this
.
tipWords
=
''
this
.
$parent
.
closeBox
()
return
this
.
$parent
.
$emit
(
'success'
,
{
captchaVerification
})
},
1000
)
}
else
{
...
...
@@ -412,24 +407,28 @@ export default {
clientUid
:
localStorage
.
getItem
(
'slider'
),
ts
:
Date
.
now
()
// 现在的时间戳
}
reqGet
(
data
).
then
((
res
)
=>
{
if
(
res
.
repCode
==
'0000'
)
{
this
.
backImgBase
=
res
.
repData
.
originalImageBase64
this
.
blockBackImgBase
=
res
.
repData
.
jigsawImageBase64
this
.
backToken
=
res
.
repData
.
token
this
.
secretKey
=
res
.
repData
.
secretKey
getBwCaptcha
(
data
).
then
((
res
)
=>
{
const
{
data
,
code
}
=
res
if
(
data
.
repCode
===
'0000'
)
{
this
.
backImgBase
=
data
.
repData
.
originalImageBase64
this
.
blockBackImgBase
=
data
.
repData
.
jigsawImageBase64
this
.
backToken
=
data
.
repData
.
token
this
.
secretKey
=
data
.
repData
.
secretKey
}
else
{
this
.
tipWords
=
res
.
repMsg
this
.
tipWords
=
data
.
repMsg
}
if
(
code
===
400
)
{
// 判断接口请求次数是否失效
if
(
res
.
repCode
==
'6201'
)
{
if
(
res
.
repCode
=
==
'6201'
)
{
this
.
backImgBase
=
null
this
.
blockBackImgBase
=
null
}
}
})
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
</
style
>
src/components/Verifition/api/index.js
deleted
100644 → 0
View file @
df298467
import
request
from
'@/utils/request'
src/views/login/login.vue
View file @
99541d74
This diff is collapsed.
Click to expand it.
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