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} +

+
); }; diff --git a/src/models/app.js b/src/models/app.js index 893e70e..755c5bf 100644 --- a/src/models/app.js +++ b/src/models/app.js @@ -539,7 +539,6 @@ export default { const webSocket = yield select(state => state.app.webSocket); let dataCode = 0; const { data } = yield call(services.postValueService, token, value, url); - console.log("=====data", data); if (utils.isEmpty(webSocket)) { const reStart = true; yield put({ type: "createWebSocket", payload: { reStart, dispatch } }); @@ -659,6 +658,8 @@ export default { // 工单系统消息 const msgData = JSON.parse(msg.data); dispatch({ type: "app/saveWorkMsg", payload: { workMsg: msgData.msg } }); + } else if (window.tempWsAction) { + window.tempWsAction(msg); } }; ws.onmessage = msg => {