var dataImg = ''; //base64位 var imgs = dataImg.replace(/^data:image\/\w+;base64,/, "");//去掉base64位头部 亲测有效