// 职业照
if(res.data.posterUrl){
this.ruleForm.jobImg.push(
{
file: {},
src: res.data.posterUrl,
isShowDel: true,
load: "ok"
}
);
}
// 身份证正面
if(res.data.idCardFrontPic){
this.ruleForm.id1.push(
{
file: {},
src: res.data.idCardFrontPic,
isShowDel: true,
load: "ok"
}
);
}
// 身份证反面
if(res.data.idCardBackPic){
this.ruleForm.id2.push(
{
file: {},
src: res.data.idCardBackPic,
isShowDel: true,
load: "ok"
}
);
}
获取数据后我会做以上处理,但中间有很多是重复了,我不知道该怎么封装它们 这怎么封装比较好呢?
这样?:
然后调用: