fix 消费二维码使用时间戳
This commit is contained in:
@@ -21,7 +21,6 @@ public class GainfoQrCodeService : IGainfoQrCodeService
|
||||
public async Task<string> GetMyQrCodeAsync(bool isNeedRefresh = false)
|
||||
{
|
||||
var jinkoCode = _currentUser.GetUserClaim("jinko-code");
|
||||
jinkoCode = "09992534";
|
||||
jinkoCode.IsEmpty().ThrowIfTrue("无法获取二维码");
|
||||
|
||||
var now = DateTime.Now;
|
||||
@@ -53,14 +52,16 @@ public class GainfoQrCodeService : IGainfoQrCodeService
|
||||
|
||||
private static string GenerateQrCode(string code)
|
||||
{
|
||||
var ts = DateTimeOffset.Now.ToUnixTimeMilliseconds();
|
||||
//var gainfo = await _dbContext.Queryable<GainfoEntity>().Where(x => x.Code == code).SingleAsync();
|
||||
var qrCode = string.Concat("consumer", ":", code, ":", Guid.NewGuid()).Replace("-", "");
|
||||
//var qrCode = string.Concat("consumer", ":", code, ":", Guid.NewGuid()).Replace("-", "");
|
||||
var qrCode = string.Concat("consumer", ":", code, ":");
|
||||
|
||||
return qrCode.ToArray().Select(x =>
|
||||
{
|
||||
var b = Encoding.ASCII.GetBytes(x.ToString());
|
||||
int i = b[0];
|
||||
return Convert.ToString(i);
|
||||
}).Join(string.Empty);
|
||||
}).Join(string.Empty) + ts;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user