formtabs缺陷漏洞补充,补充上传前格式校验

main
xuechunyuan 3 years ago
parent 926d6b95dc
commit a890ee52c7
  1. 32
      src/option/user/info.js

@ -1,6 +1,14 @@
import { Message } from 'element-ui';
export default {
tabs: true,
tabsActive: 1,
column: [
{
label:'tabs',
prop:'tabs',
display: false
}
],
group: [
{
label: '个人信息',
@ -13,15 +21,29 @@ export default {
res: 'data',
url: 'link',
},
canvasOption: {
text: ' ',
ratio: 0.1
},
// canvasOption: {
// text: ' ',
// ratio: 0.1
// },
fileType: 'img',//img/video/audio,
accept: 'image/png, image/jpeg',
action: '/api/blade-resource/oss/endpoint/put-file',
tip: '只能上传jpg/png用户头像,且不超过500kb',
span: 12,
row: true,
prop: 'avatar'
prop: 'avatar',
uploadBefore: (file, done, loading) => {
if (['image/png', 'image/jpeg'].indexOf(file.type) == -1) {
Message({
message: '只能上传jpg/png用户头像',
type: 'error'
});
loading();
}
else {
done();
}
}
}, {
label: '姓名',
span: 12,

Loading…
Cancel
Save