修复bug
This commit is contained in:
parent
92e79fbe38
commit
91bd820134
@ -99,7 +99,7 @@ namespace asg_form.Controllers.Team
|
||||
if (imageFile == null || imageFile.Length == 0)
|
||||
return BadRequest("Invalid image file.");
|
||||
// 将文件保存到磁盘
|
||||
var filePath = Path.Combine(Directory.GetCurrentDirectory(), $"loge/", $"{imageFile.FileName}");
|
||||
var filePath = Path.Combine(Directory.GetCurrentDirectory(), $"loge/", $"{for1.team_name}.png");
|
||||
using (var stream = new FileStream(filePath, FileMode.Create))
|
||||
{
|
||||
await imageFile.CopyToAsync(stream);
|
||||
|
@ -110,20 +110,26 @@ namespace asg_form.Controllers
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<object>> getmyform()
|
||||
{
|
||||
|
||||
string id = this.User.FindFirst(ClaimTypes.NameIdentifier)!.Value;
|
||||
var ouser = userManager.Users.Include(a=>a.myteam.role).FirstOrDefault(a => a.Id == id.ToInt64());
|
||||
if (ouser.myteam == null)
|
||||
{
|
||||
return BadRequest(new error_mb { code = 400, message = "你没有绑定表单" });
|
||||
|
||||
}
|
||||
foreach (var role in ouser.myteam.role)
|
||||
{
|
||||
role.Team = null;
|
||||
}
|
||||
try {
|
||||
string id = this.User.FindFirst(ClaimTypes.NameIdentifier)!.Value;
|
||||
var ouser = userManager.Users.Include(a => a.myteam.role).FirstOrDefault(a => a.Id == id.ToInt64());
|
||||
foreach (var role in ouser.myteam.role)
|
||||
{
|
||||
role.Team = null;
|
||||
}
|
||||
return Ok(ouser.myteam);
|
||||
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
return BadRequest(new error_mb { code = 400, message = "你没有绑定表单" });
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user