|
|
@ -58,7 +58,7 @@ public class SSOSupportImpl implements SSOSupport {
|
|
|
|
public String cacheClient(String appid, JSONObject clientUser) {
|
|
|
|
public String cacheClient(String appid, JSONObject clientUser) {
|
|
|
|
String code = Long.toString(System.currentTimeMillis(), 36) + RandomStringUtils.random(10, true, true);
|
|
|
|
String code = Long.toString(System.currentTimeMillis(), 36) + RandomStringUtils.random(10, true, true);
|
|
|
|
String cacheKey = accountCacheKey("client", appid, code);
|
|
|
|
String cacheKey = accountCacheKey("client", appid, code);
|
|
|
|
logger.debug("========cacheClient,key:"+cacheKey+"========");
|
|
|
|
logger.debug("========cacheClient,key:{}========", cacheKey);
|
|
|
|
stringRedisTemplate.boundValueOps(cacheKey).set(clientUser.toJSONString(), 30, TimeUnit.SECONDS);
|
|
|
|
stringRedisTemplate.boundValueOps(cacheKey).set(clientUser.toJSONString(), 30, TimeUnit.SECONDS);
|
|
|
|
return code;
|
|
|
|
return code;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -70,7 +70,7 @@ public class SSOSupportImpl implements SSOSupport {
|
|
|
|
|
|
|
|
|
|
|
|
private JSONObject getCachedAccount(String appid, String code, String type) {
|
|
|
|
private JSONObject getCachedAccount(String appid, String code, String type) {
|
|
|
|
String cacheKey = accountCacheKey(type, appid, code);
|
|
|
|
String cacheKey = accountCacheKey(type, appid, code);
|
|
|
|
logger.debug("========getCachedAccount,key:"+cacheKey+"========");
|
|
|
|
logger.debug("========getCachedAccount,key:{}========", cacheKey);
|
|
|
|
String jsonstr = stringRedisTemplate.boundValueOps(cacheKey).get();
|
|
|
|
String jsonstr = stringRedisTemplate.boundValueOps(cacheKey).get();
|
|
|
|
stringRedisTemplate.delete(cacheKey);
|
|
|
|
stringRedisTemplate.delete(cacheKey);
|
|
|
|
if (jsonstr != null) {
|
|
|
|
if (jsonstr != null) {
|
|
|
@ -81,7 +81,7 @@ public class SSOSupportImpl implements SSOSupport {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public JSONObject getCachedClientAccount(String appid, String code) {
|
|
|
|
public JSONObject getCachedClientAccount(String appid, String code) {
|
|
|
|
logger.debug("========getCachedClientAccount,appid:"+appid+",code:"+code+"========");
|
|
|
|
logger.debug("========getCachedClientAccount,appid:{},code:{}========", appid, code);
|
|
|
|
return getCachedAccount(appid, code, "client");
|
|
|
|
return getCachedAccount(appid, code, "client");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|