diff --git a/src/components/UserRegistration/index.jsx b/src/components/UserRegistration/index.jsx index 184300d..546ea8a 100644 --- a/src/components/UserRegistration/index.jsx +++ b/src/components/UserRegistration/index.jsx @@ -1,5 +1,5 @@ import { useState, useEffect } from "react"; -import { ConfigProvider, Modal, Form, Input, Select, message } from "antd"; +import { ConfigProvider, Modal, Form, Input, Select, message, Button } from "antd"; import commonConfig from "@/utils/config"; import * as commonServices from "@/services/services"; @@ -33,7 +33,7 @@ const UserRegistration = ({ _this }) => { if (!userRegisterMode) return ""; const props = UserRegistrationEvent(); - const { customerData = [] } = props; + const { customerData = [], successModalVisible } = props; const [form] = Form.useForm(); @@ -47,13 +47,40 @@ const UserRegistration = ({ _this }) => { form.submit(); }; - const onFinish = values => { - console.log("=====Success:", values); + const onFinish = ({ username, phonenumber, sCustomerId }) => { + const url = `${commonConfig.feedback_host}sftlogininfo/insertPasswordUserName/add`; + const params = { + sUserName: username, + sLanguage: "sChinese", + sBrandsId: "1111111111", + sSubsidiaryId: "1111111111", + sPhone: phonenumber, + sCustomerId, + }; + commonServices.postValueService("", params, url).then(({ data: result = {} }) => { + const { code = -1, msg = "接口出错" } = result; + if (code > -1) { + props.setState({ + successModalVisible: true, + phonenumber, + }); + } else { + message.error(msg); + } + }); }; return ( - +
{ {
+ + 确认 + + } + width={400} + > +

请等待【管理员审核】成功后用以下账号登陆!

+

+ 用户名: {props.phonenumber} +

+

+ 密    码: {props.phonenumber} +

+
); };