Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-base
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 5757ab1d
authored
Nov 15, 2022
by
liimin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改获取验证码连续点击问题
1 parent
441a7275
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
8 deletions
src/config/index.js
src/filters/filter.js
src/views/components/LoginSMSCodeCheck.vue
src/config/index.js
View file @
5757ab1
...
...
@@ -4,7 +4,7 @@
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2022-11-1
0 17:07:01
* @LastEditTime: 2022-11-1
5 17:17:35
*/
// 根据环境引入不同配置 process.env.VUE_APP_ENV
let
cfg
=
require
(
'./conf.js'
)
...
...
src/filters/filter.js
View file @
5757ab1
...
...
@@ -4,9 +4,17 @@
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 202
1-11-16 21:30:32
* @FilePath: \scrm
\scrm
-base\src\filters\filter.js
* @LastEditTime: 202
2-11-14 10:09:19
* @FilePath: \scrm-base\src\filters\filter.js
*/
export
function
accountLevel
(
value
)
{
return
[
'-'
,
'工厂'
,
'省代'
,
'市代'
,
'门店'
][
value
]
}
/**
* 手机号码脱敏处理(150****7717)
* @param {*} mobile
*/
export
function
encodeMobile
(
mobile
)
{
if
(
!
mobile
)
return
''
return
mobile
.
replace
(
mobile
.
substring
(
3
,
7
),
'****'
)
}
src/views/components/LoginSMSCodeCheck.vue
View file @
5757ab1
...
...
@@ -2,17 +2,17 @@
* @Author: limin
* @Date: 2022-11-07 11:16:08
* @LastEditors: limin
* @LastEditTime: 2022-11-
08 14:36:39
* @LastEditTime: 2022-11-
14 16:27:22
* @Description:
-->
<
template
>
<div
class=
"com-login-sms-code-check"
>
<el-dialog
title=
"手机号验证"
:visible
.
sync=
"dialogVisible"
top=
"32vh"
width=
"576px"
height=
"292px"
:destroy-on-close=
"true"
:close-on-click-modal=
"false"
>
<span
class=
"notify"
>
为了您的账号安全,请输入发送至 +86
{{
checkProps
.
mobile
}}
的4位验证码
</span>
<span
class=
"notify"
>
为了您的账号安全,请输入发送至 +86
{{
checkProps
.
mobile
|
encodeMobile
}}
的4位验证码
</span>
<el-form
:model=
"smsCodeCheckForm"
:validate-on-rule-change=
"true"
@
keyup
.
enter
.
native=
"submitForm"
:rules=
"rules"
ref=
"smsCodeCheckForm"
class=
"smsCodeCheckForm"
>
<el-form-item
prop=
"code"
>
<el-input
v-model
.
trim=
"smsCodeCheckForm.code"
autocomplete=
"off"
placeholder=
"请输入短信验证码"
maxlength=
"4"
@
input=
"onInput"
:validate-event=
"false"
></el-input>
<el-button
type=
"text"
@
click=
"getSmsCode"
v-show=
"!isShowtimeCounter"
>
获取验证码
</el-button>
<el-button
type=
"text"
@
click=
"getSmsCode"
v-show=
"!isShowtimeCounter"
:disabled=
"isShowtimeCounter"
>
获取验证码
</el-button>
<span
class=
"time-counter"
v-show=
"isShowtimeCounter"
>
{{
counter
}}
s
</span>
</el-form-item>
</el-form>
...
...
@@ -86,7 +86,7 @@ export default {
/**
* 获取短信验证码
*/
async
getSmsCode
()
{
getSmsCode
:
utils
.
debounce
(
async
function
()
{
try
{
//打开计时器倒计时60秒
this
.
startTimer
()
...
...
@@ -100,7 +100,7 @@ export default {
}
catch
(
error
)
{
Message
.
error
(
`获取短信验证码失败:
${
error
.
message
}
`
)
}
},
},
1000
),
/**
* 异步验证短信验证码
* callback
...
...
@@ -134,6 +134,7 @@ export default {
* 开启定时器 计时60秒
*/
startTimer
()
{
if
(
this
.
isShowtimeCounter
)
return
this
.
isShowtimeCounter
=
true
this
.
timer
=
setInterval
(()
=>
{
this
.
counter
--
...
...
Write
Preview
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