public OutputData Insert(IInputData input, object instance) { WeServiceUploadImgObject uploadObj = instance.Convert <WeServiceUploadImgObject>(); if (string.IsNullOrEmpty(uploadObj.FileName)) { throw new WebPostException("没有上传头像文件"); } byte[] fileData = File.ReadAllBytes(uploadObj.ServerPath); WeixinResult res = ServiceAccount.UploadHeadImg(uploadObj.Account, uploadObj.FileName, fileData); return(OutputData.CreateToolkitObject(KeyData.Empty)); }