Add WmsLite monorepo with JWT auth, tenant context, and project READMEs.
Implement API security baseline (sys_user, JWT, audit fields, transactions, unique constraints) and Web real login with 401 handling. Document setup and development workflows in root, WmsLite.Api, and WmsLite.Web README files. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
commit
fa1b286463
241 files changed
+31188
No files matched your search
@@ -0,0 +1,25 @@
|
||||
using SqlSugar;
|
||||
using WmsLite.Api.Models;
|
||||
using WmsLite.Api.Repositories.Interfaces;
|
||||
|
||||
namespace WmsLite.Api.Repositories;
|
||||
|
||||
public class SysUserRepository : ISysUserRepository
|
||||
{
|
||||
private readonly ISqlSugarClient _db;
|
||||
|
||||
public SysUserRepository(ISqlSugarClient db)
|
||||
{
|
||||
_db = db;
|
||||
}
|
||||
|
||||
public async Task<SysUser?> GetByUsernameAsync(string tenantId, string ownerCode, string username)
|
||||
{
|
||||
var tenant = tenantId.Trim();
|
||||
var owner = ownerCode.Trim();
|
||||
var user = username.Trim();
|
||||
return await _db.Queryable<SysUser>()
|
||||
.Where(x => !x.IsDeleted && x.TenantId == tenant && x.OwnerCode == owner && x.Username == user)
|
||||
.FirstAsync();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user