Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
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
黄庭坚
jinfa-platform
Commits
818b7fdf
Commit
818b7fdf
authored
Oct 13, 2021
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复验证码功能
parent
2e7ef061
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
16 deletions
+5
-16
Phone.tsx
src/components/NiceForm/components/Phone.tsx
+5
-1
forgetPwd.tsx
src/pages/user/forgetPwd.tsx
+0
-15
No files found.
src/components/NiceForm/components/Phone.tsx
View file @
818b7fdf
...
...
@@ -83,11 +83,15 @@ const Phone = (props) => {
const
validatePhoneRequest
=
async
()
=>
{
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
try
{
// 这种情况说明是忘记密码, 无需校验手机号
if
(
!
form
.
getFieldValue
(
'phone'
)
&&
form
.
getFieldValue
(
'account'
))
{
resolve
(
true
)
return
;
}
const
{
code
}
=
await
PublicApi
.
getMemberRegisterPhoneCheck
({
countryCode
:
prefixCode
,
phone
:
form
.
getFieldValue
(
'phone'
)
},
{
ctlType
:
'none'
,
useCache
:
true
,
ttl
:
60
*
1000
})
if
(
code
!==
1000
)
{
form
.
setFieldState
(
'phone'
,
state
=>
{
state
.
errors
=
[
'手机号已存在'
]
...
...
src/pages/user/forgetPwd.tsx
View file @
818b7fdf
...
...
@@ -59,21 +59,6 @@ const GetBack: React.FC = () => {
})
$
(
'onFieldValidateEnd'
,
'account'
).
subscribe
(
fieldState
=>
{
if
(
fieldState
.
valid
)
{
if
(
PATTERN_MAPS
.
phone
.
test
(
fieldState
.
value
))
{
// 校验手机号格式通过时, 需请求接口判断手机号是否存在数据库
PublicApi
.
getMemberRegisterPhoneCheck
({
countryCode
:
prefixCode
,
phone
:
fieldState
.
value
},
{
ctlType
:
'none'
,
useCache
:
true
,
ttl
:
60
*
1000
}).
then
(({
code
,
data
})
=>
{
message
.
destroy
()
if
(
code
===
1000
)
{
setFieldState
(
'account'
,
state
=>
{
state
.
errors
=
[
'手机号不存在, 请检查'
]
})
}
})
return
;
}
if
(
PATTERN_MAPS
.
email
.
test
(
fieldState
.
value
))
{
// 校验邮箱格式通过时, 需请求接口判断邮箱是否存在数据库
PublicApi
.
postMemberRegisterEmailCheck
({
...
...
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