Commit 6b7d7290 authored by 熊成伟's avatar 熊成伟

debug

parent 3ad67e50
Pipeline #16380 failed with stages
in 36 seconds
import React, {useState} from 'react';
import {WingBlank, List, InputItem, TextareaItem, WhiteSpace, Toast, DatePicker, Picker} from 'antd-mobile'
import Document from 'react-document-title';
import '../index.less';
import fileRequest from '../../utils/fileRequest';
import Upload from 'rc-upload';
import { createForm } from 'rc-form';
const Send = (props) => {
const {getFieldProps} = props.form;
const [loading, setLoading] = useState(false);
const onSubmit = () => {
props.form.validateFields({ force: true }, (error) => {
const values = props.form.getFieldsValue();
const jsonParam = {...values, _mail_option: 'send', _mail_has_blob: upload.length > 0};
setLoading(true);
const formData = new FormData();
upload.length > 0 && upload.forEach(file => {
formData.append('blob', file);
});
if (!error) {
fileRequest({
method: 'post',
url: '/idtAppServiceV6/jspmail/sendMail',
body: {jsonParam: JSON.stringify(jsonParam)},
payload: formData
}).then(res => {
Toast.success('发送成功');
props.history.push('/blank/mail');
setLoading(true)
});
}else {
Toast.fail('请输入完整的主题、收件人、内容')
}
});
};
const [upload, setUpload] = useState([]);
const uploaderProps = {
multiple: true,
beforeUpload(file) {
const newUpload = [...upload, file];
setUpload(newUpload);
return false
}
};
const uploadDelete = uid => {
const newData = [...upload];
const Index = newData.findIndex(item => item.uid === uid);
Index > -1 && newData.splice(Index, 1);
setUpload(newData)
};
const userInfo = localStorage.getItem('userInfo')
return (
<Document title="内部邮局">
<WingBlank>
<WhiteSpace/>
<form>
<List>
{/*<WingBlank>*/}
{/*{upload.length > 0 && upload.map((item, index) => (*/}
{/*<div>1111</div>*/}
{/*))}*/}
{/*</WingBlank>*/}
{/*<Upload className="auto-upload" {...uploaderProps}>*/}
{/*<a className="auto-upload">上传附件 +</a>*/}
{/*</Upload>*/}
<InputItem disabled={true} value="11111">姓名</InputItem>
<InputItem disabled={true} value="11111">账号</InputItem>
<Picker data={[{label: '男', value: '男'}, {label: '女', value: '女'}]} cols={1} {...getFieldProps('xb')}>
<List.Item arrow="horizontal">性别</List.Item>
</Picker>
<DatePicker mode="date" className="send-date-style"{...getFieldProps('gzrq')}>
<List.Item arrow="horizontal">工作日期</List.Item>
</DatePicker>
<DatePicker mode="date" className="send-date-style"{...getFieldProps('csrq')} onChange={val => console.log(val)}>
<List.Item arrow="horizontal">出生日期</List.Item>
</DatePicker>
<InputItem{...getFieldProps('gzdh')}>工作电话</InputItem>
<InputItem{...getFieldProps('yddh')}>手机号码</InputItem>
<InputItem{...getFieldProps('sjxh')}>手机小号</InputItem>
<InputItem{...getFieldProps('email')}>邮箱地址</InputItem>
</List>
</form>
<div className="event-footer">
<div className="event-footer-button" onClick={onSubmit}>保存</div>
</div>
</WingBlank>
</Document>
);
};
export default createForm()(Send);
......@@ -21,8 +21,8 @@ import MainSend from './pages/UnCommon/Mail/Send'
import People from './pages/EventProcessing/UnCommon/People'
import Login from './pages/Login'
import MeetInfo from './pages/Work/components/MeetInfo'
import NoFound from './pages/NoFound'
import User from './pages/User/User'
const ReactRouter = () => {
return (
......@@ -55,6 +55,7 @@ const ReactRouter = () => {
<Route path="/blank/work-add/:name" component={WorkAdd}/>
<Route path="/blank/submit/:flowNodeId/:uuid/:flowTbId" component={SubmitDetail}/>
<Route path="/blank/info/:id/:uuid/:FLOWTBID" component={Process}/>
<Route path="/blank/user" component={User}/>
</BlankLayout>
}/>
<Route component={NoFound}/>
......
import axios from 'axios';
import { Toast } from 'antd-mobile';
var qs = require('qs')
var qs = require('qs');
const instance = axios.create();
const token = localStorage.getItem("token");
......@@ -63,9 +63,21 @@ export const createAPI = (baseURL) => {
}
// 保存到本地
if (response && response.data && response.data.token) {
const userInfo = {
userealname: response.data.userealname,
useName: response.data.userName,
xb: response.data.xb,
gzrq: new Date(response.data.gzrq),
csrq: new Date(response.data.csrq),
gzdh: response.data.gzdh,
yddh: response.data.yddh,
sjxh: response.data.sjxh,
email: response.data.email,
};
localStorage.setItem('userInfo', JSON.stringify(userInfo))
defaultHeaders = {
token: response.data.token,
}
};
localStorage.setItem("token", response.data.token);
}
if (response && response.data && response.data.developer) {
......
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