feat tickets
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Text;
|
||||
using Dlhis.Constants;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Kurisu.AspNetCore.Authentication.Abstractions;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||
@@ -21,7 +22,7 @@ public class GainfoQrCodeService : IGainfoQrCodeService
|
||||
|
||||
public async Task<string> GetMyQrCodeAsync(bool isNeedRefresh = false)
|
||||
{
|
||||
var jinkoCode = _currentUser.GetUserClaim("jinko-code");
|
||||
var jinkoCode = _currentUser.GetUserClaim(UserClaimConstants.JinkoCode);
|
||||
if (jinkoCode.IsEmpty())
|
||||
{
|
||||
return null;
|
||||
@@ -63,11 +64,12 @@ public class GainfoQrCodeService : IGainfoQrCodeService
|
||||
var ts = DateTimeOffset.Now.ToUnixTimeMilliseconds();
|
||||
var qrCode = string.Concat("consumer", ":", code, ":");
|
||||
|
||||
return "01" + qrCode.ToArray().Select(x =>
|
||||
return QrCodeConstants.User + qrCode.ToArray().Select(x =>
|
||||
{
|
||||
var b = Encoding.ASCII.GetBytes(x.ToString());
|
||||
int i = b[0];
|
||||
return Convert.ToString(i);
|
||||
|
||||
}).Join(string.Empty) + ts;
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
using Dlhis.Basic.Device.Services;
|
||||
using Dlhis.Basic.Organization.Request;
|
||||
using Dlhis.Basic.Organization.Response;
|
||||
using Dlhis.Constants;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Dlhis.Entity.Basic.Enums;
|
||||
using Dlhis.Entity.Device.Entities;
|
||||
@@ -195,7 +196,7 @@ public class GainfoService : IGainfoService
|
||||
|
||||
public async Task<GainfoCurrentResponse> CurrentUserInfoAsync()
|
||||
{
|
||||
var code = _currentUser.GetUserClaim("jinko-code");
|
||||
var code = _currentUser.GetUserClaim(UserClaimConstants.JinkoCode);
|
||||
if (code.IsEmpty())
|
||||
{
|
||||
_logger.LogWarning("工号为空尝试获取人员信息");
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Dlhis.Constants;
|
||||
using Dlhis.Entity.Sys.Entities;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
@@ -41,7 +42,7 @@ public class IdentityUserSyncService : IIdentityUserSyncService
|
||||
|
||||
var id = (int)await _identityDbContext.InsertReturnIdentityAsync(user);
|
||||
user.Id = id;
|
||||
await AddUserClaim(_identityDbContext, id, "jinko-code", userName);
|
||||
await AddUserClaim(_identityDbContext, id, UserClaimConstants.JinkoCode, userName);
|
||||
await AddUserClaim(_identityDbContext, id, "name", name);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user