mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-08 20:49:00 +08:00
Merge branch 'master' of 786556226/pigx into dev
This commit is contained in:
commit
9e4d1835ab
2 files changed
+16
-2
No files matched your search
+15
-1
@@ -142,13 +142,27 @@ class DefaultRedisCacheWriter implements RedisCacheWriter {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除,原来是删除指定的键,目前修改为既可以删除指定键的数据,也是可以删除某个前缀开始的所有数据
|
||||
* @param name
|
||||
* @param key
|
||||
*/
|
||||
@Override
|
||||
public void remove(String name, byte[] key) {
|
||||
|
||||
Assert.notNull(name, "Name must not be null!");
|
||||
Assert.notNull(key, "Key must not be null!");
|
||||
|
||||
execute(name, connection -> connection.del(key));
|
||||
execute(name, connection ->{
|
||||
// 获取某个前缀所拥有的所有的键,某个前缀开头,后面肯定是*
|
||||
Set<byte[]> keys = connection.keys(key);
|
||||
int delNum = 0;
|
||||
Assert.notNull(keys, "keys must not be null!");
|
||||
for (byte[] keyByte : keys) {
|
||||
delNum += connection.del(keyByte);
|
||||
}
|
||||
return delNum;
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -60,7 +60,7 @@ public class ConsoleConfig {
|
||||
public CorsFilter corsFilter() {
|
||||
CorsConfiguration config = new CorsConfiguration();
|
||||
config.setAllowCredentials(true);
|
||||
config.addAllowedOrigin("*");
|
||||
config.addAllowedOriginPattern("*"); // SpringBoot2.4.0 [allowedOriginPatterns]代替[allowedOrigins]
|
||||
config.addAllowedHeader("*");
|
||||
config.setMaxAge(18000L);
|
||||
config.addAllowedMethod("*");
|
||||
|
||||
Reference in new issue
Block a user