Skip to content

Commit

Permalink
fix: 修复密钥关联配置文件规则无法保存*符号的问题 (#2805)
Browse files Browse the repository at this point in the history
  • Loading branch information
luofann authored Dec 8, 2023
1 parent 2b3268a commit 6e6da82
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,13 @@ const handleRevoke = (index: number) => {
updateRuleParams();
};
const testRule = (rule: string) => /\/([A-Za-z0-9]+[A-Za-z0-9-_.]*\/?)*$/.test(rule);
const testRule = (rule: string) => {
if (rule.length < 2) {
return false;
}
const paths = rule.split('/');
return paths.length > 1 && paths.every(path => path.length > 0);
};
const handleRuleContentChange = (index: number) => {
const rule = localRules.value[index];
Expand Down

0 comments on commit 6e6da82

Please sign in to comment.