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
5d467882
Commit
5d467882
authored
Sep 17, 2019
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
快捷登录
parent
b41c453e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
16 deletions
+16
-16
src/components/passport/common/inputWithCountryCodes/index.js
+6
-7
src/components/passport/forgotPassword/index.js
+2
-2
src/components/passport/login/index.js
+8
-7
No files found.
src/components/passport/common/inputWithCountryCodes/index.js
View file @
5d467882
import
React
,
{
Component
}
from
'react'
;
import
'./index.scss'
import
Input
from
'../Input'
import
{
Link
}
from
"react-router-dom"
;
class
InputWithCountryCodes
extends
Component
{
static
defaultProps
=
{
countryCode
:
'86'
}
render
()
{
const
{
country
Code
,
...
rest
}
=
this
.
props
const
{
country
,
...
rest
}
=
this
.
props
return
(
<
div
className
=
{
'input-with-country-codes'
}
>
<
div
className
=
"country-codes"
>
+
{
countryCode
}
<
i
className
=
{
'iconfont iconiconfront-69'
}
/
>
<
Link
to
=
{
'/country'
}
>
+
{
country
&&
country
.
num
||
86
}
<
i
className
=
{
'iconfont iconiconfront-69'
}
/
>
<
/Link
>
<
/div
>
<
Input
{...
rest
}
/
>
<
/div
>
...
...
src/components/passport/forgotPassword/index.js
View file @
5d467882
...
...
@@ -8,7 +8,7 @@ import { compose } from 'redux';
import
{
Toast
}
from
"antd-mobile"
;
import
{
HeaderBar
,
Captcha
}
from
"@/common"
;
import
ClearableInput
from
'../common/clearableInputWithCountryCodes'
import
{
validateTel
,
http
,
api
}
from
"@/utils"
;
import
{
http
}
from
"@/utils"
;
import
{
quickLogin
}
from
'@/store/userAction'
;
import
OnSubmissionError
from
'../common/OnSubmissionError'
import
{
Link
}
from
"react-router-dom"
;
...
...
@@ -111,7 +111,7 @@ const formikConfig = {
validateOnBlur
:
true
,
validate
:
values
=>
{
let
errors
=
{}
if
(
!
validateTel
(
values
.
tel
))
{
if
(
!
/
\d
/
.
test
(
values
.
tel
))
{
errors
.
tel
=
'请输入正确的手机号'
}
values
.
veriCode
.
toString
().
length
!==
6
&&
(
errors
.
veriCode
=
'验证码格式不正确'
)
...
...
src/components/passport/login/index.js
View file @
5d467882
...
...
@@ -13,7 +13,7 @@ import { connect } from 'react-redux';
import
{
compose
}
from
'redux'
;
import
{
isEmpty
}
from
'lodash'
import
{
Toast
}
from
'antd-mobile'
;
import
{
validateTel
,
getParam
}
from
"@/utils"
;
import
{
validateTel
}
from
"@/utils"
;
import
{
HeaderBar
}
from
"@/common"
;
...
...
@@ -70,7 +70,8 @@ class Login extends Component {
const
{
loginWays
,
errors
,
values
values
,
country
}
=
this
.
props
return
(
<
div
className
=
'login'
>
...
...
@@ -85,9 +86,7 @@ class Login extends Component {
type
=
{
'tel'
}
placeholder
=
{
'手机号快捷登录(免注册)'
}
wrapperClass
=
{
'tel-input'
}
/*icon={<i className={'iconfont iconshouji'}
style={{fontSize: '22px', left: '10px'}}
/>}*/
country
=
{
country
}
/
>
)}
>
...
...
@@ -109,6 +108,7 @@ class Login extends Component {
errors
=
{
errors
}
placeholder
=
{
'请输入验证码'
}
instance
=
{
this
.
state
.
captchaInstance
}
country
=
{
country
}
/
>
)}
/
>
...
...
@@ -133,7 +133,8 @@ const FormikConfig = {
handleSubmit
(
values
,
{
props
})
{
props
.
quickLogin
({
phone_num
:
values
.
tel
,
phone_code
:
values
.
veriCode
phone_code
:
values
.
veriCode
,
area_code
:
props
.
country
.
num
}).
then
(
res
=>
{
if
(
res
.
hasError
)
{
Toast
.
info
(
res
.
msg
);
...
...
@@ -159,7 +160,7 @@ const FormikConfig = {
export
default
compose
(
connect
(
null
,
state
=>
({
country
:
state
.
country
})
,
{
quickLogin
}
),
withFormik
(
FormikConfig
),
...
...
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