Commit 064546ad by Seniorious

修改照片下载为base64

parent 902183f3
...@@ -62,14 +62,14 @@ namespace APIs.Controllers ...@@ -62,14 +62,14 @@ namespace APIs.Controllers
} }
//读取图片 //读取图片
byte[] imageBytes; string imageBytes = "";
string url = pic.picUrl; string url = pic.picUrl;
using (FileStream fileStream = new FileStream(url, FileMode.Open)) using (FileStream fileStream = new FileStream(url, FileMode.Open))
{ {
using (BinaryReader reader = new BinaryReader(fileStream)) using (BinaryReader reader = new BinaryReader(fileStream))
{ {
imageBytes = reader.ReadBytes((int)fileStream.Length); imageBytes = Convert.ToBase64String(reader.ReadBytes((int)fileStream.Length));
} }
} }
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
} }
public class DownloadPicRes public class DownloadPicRes
{ {
public byte[] picture { get; set; } public string picture { get; set; }
} }
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论