|
|
|
@ -71,7 +71,7 @@ namespace Shentun.WebPeis.Persons |
|
|
|
IRepository<PatientRegister> patientRegisterRepository, |
|
|
|
IRepository<Patient> patientRepository, |
|
|
|
CacheService cacheService, |
|
|
|
IHttpContextAccessor httpContextAccessor, |
|
|
|
//IHttpContextAccessor httpContextAccessor,
|
|
|
|
IRepository<CustomerOrg> customerOrgRepository) |
|
|
|
{ |
|
|
|
_repository = repository; |
|
|
|
@ -85,7 +85,7 @@ namespace Shentun.WebPeis.Persons |
|
|
|
_patientRegisterRepository = patientRegisterRepository; |
|
|
|
_patientRepository = patientRepository; |
|
|
|
_cacheService = cacheService; |
|
|
|
_httpContextAccessor = httpContextAccessor; |
|
|
|
//_httpContextAccessor = httpContextAccessor;
|
|
|
|
_customerOrgRepository = customerOrgRepository; |
|
|
|
} |
|
|
|
|
|
|
|
@ -130,6 +130,11 @@ namespace Shentun.WebPeis.Persons |
|
|
|
|
|
|
|
var dicStr = dic.Select(m => m.Key + "=" + m.Value).DefaultIfEmpty().Aggregate((m, n) => m + "&" + n); |
|
|
|
var token = await GetTokenAsync(dicStr); |
|
|
|
var sessionKey = CacheKeys.SessionKey + Guid.NewGuid().ToString(); |
|
|
|
var sessionKeyValue = Guid.NewGuid().ToString(); |
|
|
|
_cache.Set(sessionKey, sessionKeyValue); |
|
|
|
token.SessionKey = sessionKey; |
|
|
|
token.SessionKeyValue = sessionKeyValue; |
|
|
|
return token; |
|
|
|
|
|
|
|
} |
|
|
|
@ -411,13 +416,22 @@ namespace Shentun.WebPeis.Persons |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("input不能为空"); |
|
|
|
} |
|
|
|
if (string.IsNullOrWhiteSpace(input.WechatOpenId)) |
|
|
|
//if (string.IsNullOrWhiteSpace(input.WechatOpenId))
|
|
|
|
//{
|
|
|
|
// throw new UserFriendlyException("WechatOpenId不能为空");
|
|
|
|
//}
|
|
|
|
//if (_cache.Get(CacheKeys.OpenIdKey + input.WechatOpenId) != input.WechatOpenId)
|
|
|
|
//{
|
|
|
|
// throw new UserFriendlyException("无效的WechatOpenId");
|
|
|
|
//}
|
|
|
|
|
|
|
|
if (string.IsNullOrWhiteSpace(input.SessionKey)) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("WechatOpenId不能为空"); |
|
|
|
throw new UserFriendlyException("SessionKey不能为空"); |
|
|
|
} |
|
|
|
if (_cache.Get(CacheKeys.OpenIdKey + input.WechatOpenId) != input.WechatOpenId) |
|
|
|
if (_cache.Get(input.SessionKey) != input.SessionKeyValue) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("无效的WechatOpenId"); |
|
|
|
throw new UserFriendlyException("无效的SessionKeyValue"); |
|
|
|
} |
|
|
|
|
|
|
|
if (string.IsNullOrWhiteSpace(input.PersonName)) |
|
|
|
|