function appUploadImage() {
var width = 500; //图像大小
var quality = 0.5; //图像质量
var canvas = document.createElement("canvas");
var drawer = canvas.getContext("2d");
canvas.width = width;
canvas.height = width * (img.height / img.width);
drawer.drawImage(img, 0, 0, canvas.width, canvas.height);
return canvas.toDataURL("image/png", quality);
}