|
|
@ -71,7 +71,7 @@ namespace Shentun.WebPeis.Persons |
|
|
IRepository<PatientRegister> patientRegisterRepository, |
|
|
IRepository<PatientRegister> patientRegisterRepository, |
|
|
IRepository<Patient> patientRepository, |
|
|
IRepository<Patient> patientRepository, |
|
|
CacheService cacheService, |
|
|
CacheService cacheService, |
|
|
//IHttpContextAccessor httpContextAccessor,
|
|
|
|
|
|
|
|
|
IHttpContextAccessor httpContextAccessor, |
|
|
IRepository<CustomerOrg> customerOrgRepository) |
|
|
IRepository<CustomerOrg> customerOrgRepository) |
|
|
{ |
|
|
{ |
|
|
_repository = repository; |
|
|
_repository = repository; |
|
|
@ -85,7 +85,7 @@ namespace Shentun.WebPeis.Persons |
|
|
_patientRegisterRepository = patientRegisterRepository; |
|
|
_patientRegisterRepository = patientRegisterRepository; |
|
|
_patientRepository = patientRepository; |
|
|
_patientRepository = patientRepository; |
|
|
_cacheService = cacheService; |
|
|
_cacheService = cacheService; |
|
|
//_httpContextAccessor = httpContextAccessor;
|
|
|
|
|
|
|
|
|
_httpContextAccessor = httpContextAccessor; |
|
|
_customerOrgRepository = customerOrgRepository; |
|
|
_customerOrgRepository = customerOrgRepository; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -130,11 +130,14 @@ namespace Shentun.WebPeis.Persons |
|
|
|
|
|
|
|
|
var dicStr = dic.Select(m => m.Key + "=" + m.Value).DefaultIfEmpty().Aggregate((m, n) => m + "&" + n); |
|
|
var dicStr = dic.Select(m => m.Key + "=" + m.Value).DefaultIfEmpty().Aggregate((m, n) => m + "&" + n); |
|
|
var token = await GetTokenAsync(dicStr); |
|
|
var token = await GetTokenAsync(dicStr); |
|
|
|
|
|
var options = new DistributedCacheEntryOptions() |
|
|
|
|
|
.SetAbsoluteExpiration(TimeSpan.FromDays(3)); |
|
|
var sessionKey = CacheKeys.SessionKey + Guid.NewGuid().ToString(); |
|
|
var sessionKey = CacheKeys.SessionKey + Guid.NewGuid().ToString(); |
|
|
var sessionKeyValue = Guid.NewGuid().ToString(); |
|
|
var sessionKeyValue = Guid.NewGuid().ToString(); |
|
|
_cache.Set(sessionKey, sessionKeyValue); |
|
|
|
|
|
|
|
|
_cache.Set(sessionKey, sessionKeyValue, options); |
|
|
token.SessionKey = sessionKey; |
|
|
token.SessionKey = sessionKey; |
|
|
token.SessionKeyValue = sessionKeyValue; |
|
|
token.SessionKeyValue = sessionKeyValue; |
|
|
|
|
|
|
|
|
return token; |
|
|
return token; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
@ -517,7 +520,7 @@ namespace Shentun.WebPeis.Persons |
|
|
OpenId = wechatUserDto.OpenId |
|
|
OpenId = wechatUserDto.OpenId |
|
|
}; |
|
|
}; |
|
|
var options = new DistributedCacheEntryOptions() |
|
|
var options = new DistributedCacheEntryOptions() |
|
|
.SetAbsoluteExpiration(TimeSpan.FromMinutes(720)); |
|
|
|
|
|
|
|
|
.SetAbsoluteExpiration(TimeSpan.FromDays(3)); |
|
|
_cache.Set(CacheKeys.OpenIdKey + wechatUserDto.OpenId, |
|
|
_cache.Set(CacheKeys.OpenIdKey + wechatUserDto.OpenId, |
|
|
wechatUserDto.OpenId, options); |
|
|
wechatUserDto.OpenId, options); |
|
|
|
|
|
|
|
|
|