提交 03ee66f7 authored 作者: 钟是志's avatar 钟是志

Toast 组件无法修改

上级 093d386a
...@@ -67,7 +67,7 @@ export default class UploadFile extends React.Component { ...@@ -67,7 +67,7 @@ export default class UploadFile extends React.Component {
uploadFile({ file }).then((res) => { uploadFile({ file }).then((res) => {
Toast.hide(); Toast.hide();
if (res && res.url) { if (res && res.url) {
Toast.success('上传成功!'); Toast.success('上传成功!', 1);
console.log(res); console.log(res);
this.props.returnFile( this.props.returnFile(
{ {
......
...@@ -9,7 +9,7 @@ import { Toast } from 'antd-mobile' ...@@ -9,7 +9,7 @@ import { Toast } from 'antd-mobile'
export function checkRequiredData(config = [], data = {}) { export function checkRequiredData(config = [], data = {}) {
for(let x of config){ for(let x of config){
if(x.required && (data[x.key] === '' || data[x.key] === undefined)){ if(x.required && (data[x.key] === '' || data[x.key] === undefined)){
Toast.fail( '请填写' + x.name); Toast.fail( '请填写' + x.name, 1);
return false; return false;
} }
} }
......
...@@ -29,7 +29,7 @@ function checkStatus(response) { ...@@ -29,7 +29,7 @@ function checkStatus(response) {
return response; return response;
} }
const errortext = codeMessage[response.status] || response.statusText; const errortext = codeMessage[response.status] || response.statusText;
Toast.info(`请求错误 ${response.status}: ${response.url}`) Toast.info(`请求错误 ${response.status}: ${response.url}`, 1);
const error = new Error(errortext); const error = new Error(errortext);
error.name = response.status; error.name = response.status;
error.response = response; error.response = response;
...@@ -114,7 +114,7 @@ export default function request(url, options) { ...@@ -114,7 +114,7 @@ export default function request(url, options) {
const status = e.name; const status = e.name;
if (status === 401) { if (status === 401) {
Toast.hide(); Toast.hide();
Toast.info('登录信息已过期,请重新登录'); Toast.info('登录信息已过期,请重新登录', 1);
router.push({ router.push({
pathname: '/', pathname: '/',
}); });
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论