同步
This commit is contained in:
@@ -36,12 +36,14 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
|||||||
await _userService.UpdateAsync(user_data);
|
await _userService.UpdateAsync(user_data);
|
||||||
return Result.Success();
|
return Result.Success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Route("{type}/{fileNmae}")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public IActionResult Get(string type, string imageNmae)
|
public IActionResult Get(string type, string fileNmae)
|
||||||
{
|
{
|
||||||
var path = Path.Combine($"wwwroot\\{type}", imageNmae);
|
var path = Path.Combine($"wwwroot\\{type}", fileNmae);
|
||||||
var stream = System.IO.File.OpenRead(path);
|
var stream = System.IO.File.OpenRead(path);
|
||||||
var MimeType = Common.Helper.MimeHelper.GetMimeMapping(imageNmae);
|
var MimeType = Common.Helper.MimeHelper.GetMimeMapping(fileNmae);
|
||||||
return new FileStreamResult(stream, MimeType);
|
return new FileStreamResult(stream, MimeType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import myaxios from '@/util/myaxios'
|
import myaxios from '@/util/myaxios'
|
||||||
export default {
|
export default {
|
||||||
Upload(file) {
|
EditIcon(file) {
|
||||||
return myaxios({
|
return myaxios({
|
||||||
url: '/File/Upload',
|
url: '/File/EditIcon',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
headers: { "Content-Type": "multipart/form-data" },
|
headers: { "Content-Type": "multipart/form-data" },
|
||||||
data: file
|
data: file
|
||||||
|
|||||||
@@ -334,7 +334,7 @@ choiceImg() {
|
|||||||
const file = this.$refs.imgFile.files[0];
|
const file = this.$refs.imgFile.files[0];
|
||||||
let formData = new FormData();
|
let formData = new FormData();
|
||||||
formData.append("img", file);
|
formData.append("img", file);
|
||||||
fileApi.Upload(formData).then(resp=>{
|
fileApi.EditIcon(formData).then(resp=>{
|
||||||
this.init();
|
this.init();
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user