diff --git a/src/pages/identity/index.tsx b/src/pages/identity/index.tsx index 44ddf84..33f74b3 100644 --- a/src/pages/identity/index.tsx +++ b/src/pages/identity/index.tsx @@ -17,6 +17,7 @@ import { IdentityModelState } from './model'; import kycIdCover from '@/assets/kycIdCover.svg'; import kycIdBack from '@/assets/kycIdBack.svg' +import http from '@/utils/http'; const idtypes = [ {key:'idcard', value:'身份证'}, @@ -40,6 +41,8 @@ const IdentityPage: React.FC const picBack = React.createRef(); const [idtypesVisible, setIdtypesVisible] = useState(false); const [nationVisible, setNationVisible] = useState(false); + const [realname, setRealname] = useState(); + const [idNo, setIdNo] = useState(); const onPicCover = (key: any) => { console.log(key); @@ -79,7 +82,7 @@ const IdentityPage: React.FC title={formatMessage({ id: 'identity.chooseIdtype' })} /> ); - const submitHandler = () => { + const submitHandler = async () => { const formData = new FormData(); const pic1 = picCover.current.files[0]; const pic2 = picBack.current.files[0]; @@ -87,10 +90,10 @@ const IdentityPage: React.FC // const p2 = new FileReader(pic2); formData.append('pic1', pic1); formData.append('pic2', pic2); - /** - 可以在这里直接 - axios.post(url, formData) - */ + formData.append('realname', realname); + formData.append('idNo', idNo); + const data = await http.post('/user/verify', formData); + console.log(data); } return (
@@ -102,8 +105,8 @@ const IdentityPage: React.FC dispatch({ type: 'identity/onUpdateState', idcode: e.target.value })} + value={idNo} + onChange={e => setIdNo(e.target.value)} />
@@ -122,8 +125,8 @@ const IdentityPage: React.FC dispatch({ type: 'identity/onUpdateState', realname: e.target.value })} + value={realname} + onChange={e => setRealname(e.target.value)} /> {/*