feat: 修改redis存储策略
This commit is contained in:
@@ -29,7 +29,7 @@ public class SmsInitConfig implements SmartLifecycle {
|
||||
@Resource
|
||||
RedisUtil redisUtil;
|
||||
|
||||
private final String smsConfigPrefix="sys.common";
|
||||
private final String smsConfigPrefix="system:config";
|
||||
|
||||
public void init() {
|
||||
ConfigInfo configInfo = configRpc.getConfigInfo(SmsConfigContext.SMS_CONFIG_KEY);
|
||||
|
@@ -26,7 +26,7 @@ public class ReactRotateCaptchaController {
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
public final String authRotateCaptchaPrefix = "auth.rotate.captcha";
|
||||
public final String authRotateCaptchaPrefix = "auth:user:captcha";
|
||||
|
||||
|
||||
/**
|
||||
|
@@ -54,7 +54,7 @@ public class SchisandraAuthUserController {
|
||||
@Resource
|
||||
private SchisandraAuthUserDomainService schisandraAuthUserDomainService;
|
||||
|
||||
private final String AUTH_PHONE_PREFIX = "auth.phone";
|
||||
private final String AUTH_PHONE_PREFIX = "auth:user:phone";
|
||||
|
||||
@Resource
|
||||
private CheckRouteCaptcha checkRouteCaptcha;
|
||||
@@ -62,13 +62,13 @@ public class SchisandraAuthUserController {
|
||||
@Resource
|
||||
private SchisandraAuthRoleDomainService schisandraAuthRoleDomainService;
|
||||
|
||||
private final String AUTH_PERMISSION_PREFIX = "auth.permission";
|
||||
private final String AUTH_PERMISSION_PREFIX = "auth:user:permission";
|
||||
|
||||
private final String AUTH_ROLE_PREFIX = "auth.role";
|
||||
private final String AUTH_ROLE_PREFIX = "auth:user:role";
|
||||
|
||||
private final String WX_LOGIN_TEMPORARY_CLIENT_ID = "wechat.client.id";
|
||||
private final String WX_LOGIN_TEMPORARY_CLIENT_ID = "wechat:client:id";
|
||||
|
||||
private final String WX_LOGIN_TOKEN = "wechat.login.token";
|
||||
private final String WX_LOGIN_TOKEN = "wechat:login:token";
|
||||
|
||||
@Resource
|
||||
private SchisandraAuthRolePermissionDomainService schisandraAuthRolePermissionDomainService;
|
||||
@@ -76,9 +76,6 @@ public class SchisandraAuthUserController {
|
||||
@Resource
|
||||
private SchisandraAuthPermissionDomainService schisandraAuthPermissionDomainService;
|
||||
|
||||
@Value("${web.url}")
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* @description: 注册
|
||||
* @param: [schisandraAuthUserDTO]
|
||||
|
@@ -30,8 +30,8 @@ public class SchisandraSmsController {
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
private final String AUTH_PHONE_PREFIX = "auth.phone";
|
||||
private final String SMS_CONFIG_PREFIX = "sys.config";
|
||||
private final String AUTH_PHONE_PREFIX = "auth:user:phone";
|
||||
private final String SMS_CONFIG_PREFIX = "system:config";
|
||||
|
||||
@Resource
|
||||
CheckRouteCaptcha checkRouteCaptcha;
|
||||
|
@@ -19,7 +19,7 @@ import javax.annotation.Resource;
|
||||
public class CheckRouteCaptcha {
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
public final String authRotateCaptchaPrefix = "auth.rotate.captcha";
|
||||
public final String authRotateCaptchaPrefix = "auth:user:captcha";
|
||||
public CaptchaResult checkCaptcha(String token, Double deg) {
|
||||
if (deg == null && token == null) {
|
||||
return CaptchaResult.fail();
|
||||
|
@@ -24,7 +24,7 @@ public class RedisUtil {
|
||||
@Resource
|
||||
private RedisTemplate redisTemplate;
|
||||
|
||||
private static final String CACHE_KEY_SEPARATOR = ".";
|
||||
private static final String CACHE_KEY_SEPARATOR = ":";
|
||||
|
||||
/**
|
||||
* 构建缓存key
|
||||
|
@@ -56,11 +56,11 @@ public class SchisandraAuthUserDomainServiceImpl implements SchisandraAuthUserDo
|
||||
private SchisandraSocialUserAuthService schisandraSocialUserAuthService;
|
||||
|
||||
|
||||
private final String AUTH_PERMISSION_PREFIX = "auth.permission";
|
||||
private final String AUTH_PERMISSION_PREFIX = "auth:user:permission";
|
||||
|
||||
private final String AUTH_ROLE_PREFIX = "auth.role";
|
||||
private final String AUTH_ROLE_PREFIX = "auth:user:role";
|
||||
|
||||
private final String WX_LOGIN_TOKEN = "wechat.login.token";
|
||||
private final String WX_LOGIN_TOKEN = "wechat:login:token";
|
||||
|
||||
@Resource
|
||||
RedisUtil redisUtil;
|
||||
|
@@ -26,9 +26,9 @@ public class StpInterfaceImpl implements StpInterface {
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
private final String AUTH_PERMISSION_PREFIX = "auth.permission";
|
||||
private final String AUTH_PERMISSION_PREFIX = "auth:user:permission";
|
||||
|
||||
private final String AUTH_ROLE_PREFIX = "auth.role";
|
||||
private final String AUTH_ROLE_PREFIX = "auth:user:role";
|
||||
|
||||
@Override
|
||||
public List<String> getPermissionList(Object userId, String loginType) {
|
||||
|
@@ -23,7 +23,7 @@ public class RedisUtil {
|
||||
@Resource
|
||||
private RedisTemplate redisTemplate;
|
||||
|
||||
private static final String CACHE_KEY_SEPARATOR = ".";
|
||||
private static final String CACHE_KEY_SEPARATOR = ":";
|
||||
|
||||
/**
|
||||
* 构建缓存key
|
||||
|
@@ -24,7 +24,7 @@ public class RedisUtil {
|
||||
@Resource
|
||||
private RedisTemplate redisTemplate;
|
||||
|
||||
private static final String CACHE_KEY_SEPARATOR = ".";
|
||||
private static final String CACHE_KEY_SEPARATOR = ":";
|
||||
|
||||
/**
|
||||
* 构建缓存key
|
||||
|
@@ -24,7 +24,7 @@ public class RedisUtil {
|
||||
@Resource
|
||||
private RedisTemplate redisTemplate;
|
||||
|
||||
private static final String CACHE_KEY_SEPARATOR = ".";
|
||||
private static final String CACHE_KEY_SEPARATOR = ":";
|
||||
|
||||
/**
|
||||
* 构建缓存key
|
||||
|
@@ -24,7 +24,7 @@ public class RedisUtil {
|
||||
@Resource
|
||||
private RedisTemplate redisTemplate;
|
||||
|
||||
private static final String CACHE_KEY_SEPARATOR = ".";
|
||||
private static final String CACHE_KEY_SEPARATOR = ":";
|
||||
|
||||
/**
|
||||
* 构建缓存key
|
||||
|
@@ -30,7 +30,7 @@ public class WXServiceImpl implements WXService {
|
||||
@Resource
|
||||
RedisUtil redisUtil;
|
||||
|
||||
final String WX_ACCESS_TOKEN_REDIS_KEY = "wx_access_token";
|
||||
final String WX_ACCESS_TOKEN_REDIS_KEY = "wechat:token";
|
||||
//接口重试次数
|
||||
int retry = 3;
|
||||
|
||||
|
@@ -80,7 +80,7 @@ public class WxMpEventServiceImpl implements WxMpEventService {
|
||||
String[] keys = mpSubscribeEventRequest.getEventKey().split("_");
|
||||
if ("qrscene".equals(keys[0]) && "ScanReg".equals(keys[1])) {
|
||||
log.info("AppId:{},ClientId:{}", keys[2], keys[3]);
|
||||
authUserRpc.wechatRegister(keys[2], mpSubscribeEventRequest.getToUserName(), keys[3]);
|
||||
authUserRpc.wechatRegister(keys[2], mpSubscribeEventRequest.getFromUserName(), keys[3]);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user