|
|
|
|
|
|
|
|
if (!hasText(openId)) throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("Token已失效"); |
|
|
if (!hasText(openId)) throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("Token已失效"); |
|
|
return openId; |
|
|
return openId; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected String findAgencyIdByToken(String accessToken) throws ServiceHandleException { |
|
|
|
|
|
String agencyId = redisManager.get(RedisKeyGenerator.getLoginAgencyIdKey(accessToken)); |
|
|
|
|
|
if (!hasText(agencyId)) throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("Token已失效"); |
|
|
|
|
|
return agencyId; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected AccountInfo findAccountInfoyToken(String accessToken) throws ServiceHandleException { |
|
|
|
|
|
String accountInfoStr = redisManager.get(RedisKeyGenerator.getLoginAccountInfoKey(accessToken)); |
|
|
|
|
|
if (!hasText(accountInfoStr)) throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("Token已失效"); |
|
|
|
|
|
try { |
|
|
|
|
|
return JsonTools.json2Object(accountInfoStr, AccountInfo.class); |
|
|
|
|
|
} catch (IOException e) { |
|
|
|
|
|
logger.error(e.getMessage()); |
|
|
|
|
|
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("Token已失效,解析失败"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |