Commit c79ad344 by 姜雷

修改获取验证码方式

parent ab50e845
import { baseFetch } from '.';
import { baseFetch, customerFetch } from '.';
type ImageVcodePramas = {
effective?: number;
......@@ -12,11 +12,12 @@ export const getImageVcode = (data: ImageVcodePramas) =>
data: data,
});
type VcodePramas = {
businessNum: string;
codeNum?: number;
cellphone: string;
};
export const getVcode = (entity: VcodePramas) =>
baseFetch({
url: `/common/sendMsgCode?cellphone=${entity.cellphone}&codeNum=6`,
method: 'POST',
customerFetch({
url: '/app/customer/phone/message',
data: entity,
});
......@@ -7,6 +7,7 @@ import './Vcode.scss';
import { ResponseDataEntity } from 'src/api';
type PageOwnProps = {
positionNum: string;
text?: string;
cellphone: string;
};
......@@ -99,10 +100,11 @@ class Vcode extends Component {
clickHandle() {
const { vcode, inputCode } = this.state;
if (vcode && vcode.toString() == inputCode) {
const { cellphone } = this.props;
const { cellphone, positionNum } = this.props;
getVcode({
cellphone: cellphone,
businessNum: positionNum,
})
.then(res => {
this.countStart();
......
......@@ -318,6 +318,7 @@ class Register extends Component {
/>
<Vcode
vcode-classname='registerBox-getVcode'
positionNum='2'
ref='Vcode'
cellphone={cellphone}
/>
......
......@@ -167,6 +167,7 @@ class ResetPwd extends Component {
/>
<Vcode
vcode-classname='registerBox-getVcode'
positionNum='3'
ref='Vcode'
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