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