Commit 728569b5 by zhangleyuan

feat:增加图片上传失败得提示

parent bd490c76
import { func } from "prop-types"; import { func } from "prop-types";
import Service from '@/common/js/service'; import Service from '@/common/js/service';
import User from '@/common/js/user'; import User from '@/common/js/user';
import { message } from 'antd';
/* /*
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-08-11 11:47:14 * @Date: 2020-08-11 11:47:14
* @LastEditors: zhangleyuan * @LastEditors: zhangleyuan
* @LastEditTime: 2020-12-07 15:53:10 * @LastEditTime: 2020-12-15 16:52:27
* @Description: * @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -105,6 +106,9 @@ class Upload { ...@@ -105,6 +106,9 @@ class Upload {
xhr.open('POST', signInfo.host.replace(/http:/, "https:"), true); xhr.open('POST', signInfo.host.replace(/http:/, "https:"), true);
xhr.onload = () => { xhr.onload = () => {
const result = JSON.parse(xhr.responseText); const result = JSON.parse(xhr.responseText);
if(!result.success){
message.error('上传失败');
}
resolve(result.url); resolve(result.url);
} }
xhr.send(fd); xhr.send(fd);
......
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