2025.1.25的bug

This commit is contained in:
王炜翔 2025-01-26 15:58:36 +08:00
parent f3895f3bcf
commit 73f2a80b2c
2 changed files with 12 additions and 7 deletions

View File

@ -31,6 +31,7 @@ namespace asg_form.Controllers.Teamregistration
public string status { get; set; }
public string biz_type { get; set; }
public string req_role { get; set; }
public string intro_url { get; set; }
}
public class userMsg
{
@ -45,6 +46,7 @@ namespace asg_form.Controllers.Teamregistration
public int? id { get; set; }
public string bizType { get; set; }
public string reqRole { get; set; }
public string introUrl { get; set; }
}
public class RegisterController : ControllerBase
{
@ -91,6 +93,7 @@ namespace asg_form.Controllers.Teamregistration
approval_time = "未审核",
biz_type = msg.bizType,
req_role = msg.reqRole,
intro_url = msg.introUrl,
};
sub.T_Comform.Add(rgst);
await sub.SaveChangesAsync();
@ -127,6 +130,7 @@ namespace asg_form.Controllers.Teamregistration
query.status = "1";
query.biz_type = msg.bizType;
query.req_role = msg.reqRole;
query.intro_url = msg.introUrl;
await sub.SaveChangesAsync();
string mesg = $"ASG管理系统有新解说申请请及时上后台系统审批。";
string qqgroup = "925510646";
@ -268,9 +272,10 @@ namespace asg_form.Controllers.Teamregistration
{
var query = testDb.T_Comform.FirstOrDefault(c => c.user_id == userId);
var user = await userManager.Users.FirstOrDefaultAsync(u => u.Id == userId);
if (query == null ) return Ok(new { code = 404, message = "用户1未找到" });
if (user == null) return Ok(new { code = 404, message = "用户2未找到" });
query.status = "4";
if (user == null) return Ok(new { code = 404, message = "用户未找到" });
if (query != null) {query.status = "4"; }
user.officium = null;
await testDb.SaveChangesAsync();
await userManager.UpdateAsync(user);

View File

@ -305,12 +305,12 @@ namespace asg_form.Controllers
/// <param name="keyword">搜索关键字</param>
/// <param name="pageindex">页码默认为1</param>
/// <param name="pagesize">每页大小默认为10</param>
/// <param name="officum">部门筛选条件</param>
/// <param name="officium">部门筛选条件</param>
/// <returns>返回分页后的用户列表及总数</returns>
[Route("api/v2/admin/allperson")]
[HttpGet]
[Authorize]
public async Task<ActionResult<all_record>> GetAdminUsersV2(string? keyword = null, short pageindex = 1, short pagesize = 10, string? officum = null)
public async Task<ActionResult<all_record>> GetAdminUsersV2(string? keyword = null, short pageindex = 1, short pagesize = 10, string? officium = null)
{
// 检查用户是否有管理员权限
if (!this.User.HasClaim(ClaimTypes.Role, "admin"))
@ -326,9 +326,9 @@ public async Task<ActionResult<all_record>> GetAdminUsersV2(string? keyword = nu
query = query.Where(u => u.chinaname.Contains(keyword) || u.UserName == keyword || u.Email == keyword);
}
if (!string.IsNullOrEmpty(officum))
if (!string.IsNullOrEmpty(officium))
{
query = query.Where(u => u.officium == officum);
query = query.Where(u => u.officium == officium);
}
// 获取总记录数