diff --git a/asg_form/Controllers/Com.cs b/asg_form/Controllers/Com.cs index b9b3ad0..9199611 100644 --- a/asg_form/Controllers/Com.cs +++ b/asg_form/Controllers/Com.cs @@ -56,7 +56,11 @@ namespace asg_form.Controllers var user = await userManager.FindByIdAsync(id); if (user.officium == "Commentator") { - + if (user.Integral == null) + { + user.Integral = 0; + await userManager.UpdateAsync(user); + } TestDbContext testDb = new TestDbContext(); string chinaname = user.chinaname; var teamgame = await testDb.team_Games.FirstAsync(a => a.id == gameid); @@ -107,6 +111,11 @@ namespace asg_form.Controllers { string id = this.User.FindFirst(ClaimTypes.NameIdentifier)!.Value; var user = await userManager.FindByIdAsync(id); + if (user.Integral == null) + { + user.Integral = 0; + await userManager.UpdateAsync(user); + } if (user.officium == "Commentator") { TestDbContext testDb = new TestDbContext(); diff --git a/asg_form/Controllers/Store/Storehttp.cs b/asg_form/Controllers/Store/Storehttp.cs index 86eb0b4..fc87373 100644 --- a/asg_form/Controllers/Store/Storehttp.cs +++ b/asg_form/Controllers/Store/Storehttp.cs @@ -116,6 +116,22 @@ namespace asg_form.Controllers.Store } + [Route("api/v1/Store/my")] + [HttpGet] + [Authorize] + public async Task> mybuy() + { + long id = this.User.FindFirst(ClaimTypes.NameIdentifier)!.Value.ToInt64(); + + + using (TestDbContext sb = new TestDbContext()) + { + var a = sb.T_Storeinfo.Where(a=>a.buyerid==id).ToListAsync(); + return Ok(a); + } + } + + /// diff --git a/asg_form/asg_form.csproj b/asg_form/asg_form.csproj index 6e5e9de..12f488a 100644 --- a/asg_form/asg_form.csproj +++ b/asg_form/asg_form.csproj @@ -10,6 +10,13 @@ False + + + + + + + @@ -50,7 +57,6 @@ -