/// <summary> /// 生成Token 保存在redis里 /// </summary> /// <param name="tenantId"></param> /// <param name="userId"></param> public string GenerateToken(int tenantId, int userId, string loginName) { var guid = Guid.NewGuid().ToString("N"); var value = SecurityHelper.GetMd5($"{tenantId}_{userId}_Schedule_{guid}"); RedisCacheHelper.PipelineSet(tenantId, MakeUserGuidKey(loginName), guid, () => { RedisCacheHelper.PipelineSet(tenantId, MakeUserTokenKey(loginName), value); }); return(value); }