修改问题
This commit is contained in:
parent
8f835754e3
commit
2e4c44d3f0
|
|
@ -134,8 +134,9 @@ namespace CloudGaming.Code.Account
|
||||||
userCurrency = new List<T_User_Currency>();
|
userCurrency = new List<T_User_Currency>();
|
||||||
}
|
}
|
||||||
var userCurrencyDic = userCurrency.ToDictionary(it => (UserCurrencyType)it.CurrencyType);
|
var userCurrencyDic = userCurrency.ToDictionary(it => (UserCurrencyType)it.CurrencyType);
|
||||||
|
var userPlayGameTime = await Dao.DaoPhone.Context.T_User_PlayGameTime.Where(it => it.UserId == userId).SumAsync(it => (int?)it.PlayTime);
|
||||||
//创建用户缓存
|
//创建用户缓存
|
||||||
await AccountExtend.LogUserInfoCahceAsync(RedisCache, user, userData, userCurrencyDic);
|
await AccountExtend.LogUserInfoCahceAsync(RedisCache, user, userData, userCurrencyDic, userPlayGameTime ?? 0);
|
||||||
|
|
||||||
//创建jwt登录
|
//创建jwt登录
|
||||||
var jwt = GenerateJwtToken(user);
|
var jwt = GenerateJwtToken(user);
|
||||||
|
|
|
||||||
|
|
@ -174,11 +174,16 @@ namespace CloudGaming.Code.Account
|
||||||
/// <param name="userData"></param>
|
/// <param name="userData"></param>
|
||||||
/// <param name="userCurrency"></param>
|
/// <param name="userCurrency"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static async Task<UserInfoCache?> LogUserInfoCahceAsync(IDatabase database, T_User user, T_User_Data? userData = null, Dictionary<UserCurrencyType, T_User_Currency> userCurrency = null)
|
public static async Task<UserInfoCache?> LogUserInfoCahceAsync(IDatabase database, T_User user, T_User_Data? userData = null, Dictionary<UserCurrencyType, T_User_Currency> userCurrency = null, int userPlayGameTime = 0)
|
||||||
{
|
{
|
||||||
var key = GetUserInfoRedisKey(user.Id);
|
var key = GetUserInfoRedisKey(user.Id);
|
||||||
var userInfo = new UserInfoCache() { };
|
var userInfo = new UserInfoCache() { };
|
||||||
LoadUserInfo(userInfo, user, userData, userCurrency);
|
LoadUserInfo(userInfo, user, userData, userCurrency);
|
||||||
|
if (userPlayGameTime != 0)
|
||||||
|
{
|
||||||
|
//var userPlayGameTime = await Dao.DaoPhone.Context.T_User_PlayGameTime.Where(it => it.UserId == userId).SumAsync(it => (int?)it.PlayTime);
|
||||||
|
userInfo.UserPlayGameTime = userPlayGameTime;// userPlayGameTime ?? 0;
|
||||||
|
}
|
||||||
await database.StringSetAsync(key, userInfo, TimeSpan.FromHours(1));
|
await database.StringSetAsync(key, userInfo, TimeSpan.FromHours(1));
|
||||||
return userInfo;
|
return userInfo;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user