Commit c79ad344 by 姜雷

修改获取验证码方式

parent ab50e845
import { baseFetch } from '.'; import { baseFetch, customerFetch } from '.';
type ImageVcodePramas = { type ImageVcodePramas = {
effective?: number; effective?: number;
...@@ -12,11 +12,12 @@ export const getImageVcode = (data: ImageVcodePramas) => ...@@ -12,11 +12,12 @@ export const getImageVcode = (data: ImageVcodePramas) =>
data: data, data: data,
}); });
type VcodePramas = { type VcodePramas = {
businessNum: string;
codeNum?: number;
cellphone: string; cellphone: string;
}; };
export const getVcode = (entity: VcodePramas) => export const getVcode = (entity: VcodePramas) =>
baseFetch({ customerFetch({
url: `/common/sendMsgCode?cellphone=${entity.cellphone}&codeNum=6`, url: '/app/customer/phone/message',
method: 'POST',
data: entity, data: entity,
}); });
...@@ -7,6 +7,7 @@ import './Vcode.scss'; ...@@ -7,6 +7,7 @@ import './Vcode.scss';
import { ResponseDataEntity } from 'src/api'; import { ResponseDataEntity } from 'src/api';
type PageOwnProps = { type PageOwnProps = {
positionNum: string;
text?: string; text?: string;
cellphone: string; cellphone: string;
}; };
...@@ -99,10 +100,11 @@ class Vcode extends Component { ...@@ -99,10 +100,11 @@ class Vcode extends Component {
clickHandle() { clickHandle() {
const { vcode, inputCode } = this.state; const { vcode, inputCode } = this.state;
if (vcode && vcode.toString() == inputCode) { if (vcode && vcode.toString() == inputCode) {
const { cellphone } = this.props; const { cellphone, positionNum } = this.props;
getVcode({ getVcode({
cellphone: cellphone, cellphone: cellphone,
businessNum: positionNum,
}) })
.then(res => { .then(res => {
this.countStart(); this.countStart();
......
...@@ -318,6 +318,7 @@ class Register extends Component { ...@@ -318,6 +318,7 @@ class Register extends Component {
/> />
<Vcode <Vcode
vcode-classname='registerBox-getVcode' vcode-classname='registerBox-getVcode'
positionNum='2'
ref='Vcode' ref='Vcode'
cellphone={cellphone} cellphone={cellphone}
/> />
......
...@@ -167,6 +167,7 @@ class ResetPwd extends Component { ...@@ -167,6 +167,7 @@ class ResetPwd extends Component {
/> />
<Vcode <Vcode
vcode-classname='registerBox-getVcode' vcode-classname='registerBox-getVcode'
positionNum='3'
ref='Vcode' ref='Vcode'
cellphone={cellphone} cellphone={cellphone}
/> />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment