昨天我为此写了一个工作代码,但我删除了它,当写一个新的代码时,有些东西真的很奇怪:我用这种方式编码图片:letpictureData=UIImagePNGRepresentation(picture!)letpictureToString64=pictureData?.base64EncodedStringWithOptions(NSDataBase64EncodingOptions.Encoding64CharacterLineLength)(我之前有JPEGRepresentation,但它不起作用,所以我尝试使用JPEG)我通过获取pic64以这种方式解码,我相信它具有正确的值。