mirror of
https://gitee.com/dromara/sa-token.git
synced 2024-11-30 02:48:10 +08:00
fix(SaFoxUtil): 修复权限正则匹配模式
旧代码存在: user.* 会匹配 usermgt.list 新代码修复: user.* 只会匹配 user.add user.update 等,匹配模式必须包含user.前缀 且使用replace性能比replaceAll正则替换要高
This commit is contained in:
parent
26c312f8d6
commit
a1a67ca606
@ -252,7 +252,7 @@ public class SaFoxUtil {
|
||||
return patt.equals(str);
|
||||
}
|
||||
// 正则匹配
|
||||
return Pattern.matches(patt.replaceAll("\\*", ".*"), str);
|
||||
return Pattern.matches(patt.replace(".*", "\\..*"), str);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user