Commit eaf50798 by 姜雷

修改部分接口

parent 2766a416
import { baseFetch } from '.';
type ImageVcodePramas = {
effective?: number;
loginName: string;
codeNum?: number;
};
export const getImageVcode = (data: ImageVcodePramas) =>
baseFetch({
url: `/common/getCode?loginName=${data.loginName}&codeNum=4`,
method: 'POST',
data: data,
});
type VcodePramas = {
cellphone: string;
};
export const getVcode = (entity: VcodePramas) =>
baseFetch({
url: `/common/sendMsgCode?cellphone=${entity.cellphone}&codeNum=6`,
method: 'POST',
data: entity,
});
import { oldBaseFetch, baseFetch, ResponseDataEntity } from './index';
import { UserState } from '../store/rootReducers/userinfo';
type LoginPramas = {
code: string;
};
type LoginReponseData = {
register: boolean;
wxToken: string;
} & UserState;
export interface LoginReponse extends ResponseDataEntity<LoginReponseData> {
data: LoginReponseData;
}
export const login = (data: LoginPramas) =>
oldBaseFetch({
url: '/wx/api/user/login2',
data: data,
});
export const fetchValidateCode = () =>
oldBaseFetch({
url: '/wx/api/getValidateCode',
});
type ImageVcodePramas = {
effective?: number;
loginName: string;
codeNum?: number;
};
export const getImageVcode = (data: ImageVcodePramas) =>
baseFetch({
url: `/common/getCode?loginName=${data.loginName}&codeNum=4`,
method: 'POST',
data: data,
});
export const getVcode = entity =>
oldBaseFetch({
url: '/wx/api/getValidateCode',
method: 'POST',
data: entity,
});
type RegisiterPramas = {};
// type RegisiterReponseData = {};
export const fetchWxUserRegister = (entity: RegisiterPramas) =>
baseFetch({
url: '/dcxy/wechat/applet/register/',
method: 'POST',
data: entity,
});
......@@ -20,6 +20,9 @@ interface Modal {
class Modal extends Component {
static externalClasses = ['body-class'];
static options = {
addGlobalClass: true,
};
static defaultProps = {
visiabled: false,
title: '提示',
......
......@@ -19,6 +19,17 @@
border-radius: 12px;
overflow: hidden;
}
.mask {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
width: 100%;
height: 100%;
background-color: rgba(25, 25, 25, 0.2);
z-index: 99;
}
}
.Vcode.Counting {
color: #999;
......
import { ComponentClass } from 'react';
import Taro, { Component } from '@tarojs/taro';
import { View, Input, Canvas } from '@tarojs/components';
import { getVcode, getImageVcode } from '../../api/wx';
import { getVcode, getImageVcode } from '../../api/vcode';
import Modal from '../Modal/Modal';
import './Vcode.scss';
import { ResponseDataEntity } from 'src/api';
......@@ -66,7 +66,7 @@ class Vcode extends Component {
this.setState({
showImgBox: true,
});
this.renderImg(1234);
// this.renderImg(1234);
} else {
Taro.showToast({
title: '输入正确的手机号',
......@@ -102,7 +102,7 @@ class Vcode extends Component {
const { cellphone } = this.props;
getVcode({
tel: cellphone,
cellphone: cellphone,
})
.then(res => {
this.countStart();
......
......@@ -31,7 +31,7 @@ class ResetPwd extends Component {
constructor(props: PageOwnProps) {
super(props);
this.state = {
cellphone: '18108096099',
cellphone: '',
vcode: '',
pwd: '',
checkPwd: '',
......@@ -111,7 +111,14 @@ class ResetPwd extends Component {
}
}
render() {
const { cellphone, vcode, showPwd, pwd,showCheckPwd, checkPwd } = this.state;
const {
cellphone,
vcode,
showPwd,
pwd,
showCheckPwd,
checkPwd,
} = this.state;
return (
<View className='ResetPwd'>
<ToastBox ref='ToastBox' />
......
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