We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
当路径中连续两个item为相同字符串时会出现验证错误 eg: 当我们调用 $policy->check($path) 如果$path传入的是类似这样 /Api/Admin/Merchant/Merchant/getMerchantList 因为有连续两个 Merchant 则会获取不到最后一个 getMerchantList
在class EasySwoole\Policy\PolicyNode 中的 search() 方法 调试可以看到 大约123行至125行中 是因为这个判断提前返回了 if($name == $this->name){ return $this; }
如果两个名字相同则返回,并不会继续向下判断。
经测试改成如下判断可以解决: if($name == $this->name && !isset($this->leaves[$name]) && !isset($this->leaves['*'])){ return $this; }
如需讨论可在issue回复。
The text was updated successfully, but these errors were encountered:
已修复,#7 #5
Sorry, something went wrong.
No branches or pull requests
当路径中连续两个item为相同字符串时会出现验证错误
eg:
当我们调用
$policy->check($path)
如果$path传入的是类似这样
/Api/Admin/Merchant/Merchant/getMerchantList
因为有连续两个 Merchant 则会获取不到最后一个 getMerchantList
在class EasySwoole\Policy\PolicyNode 中的 search() 方法 调试可以看到
大约123行至125行中
是因为这个判断提前返回了
if($name == $this->name){
return $this;
}
如果两个名字相同则返回,并不会继续向下判断。
经测试改成如下判断可以解决:
if($name == $this->name && !isset($this->leaves[$name]) && !isset($this->leaves['*'])){
return $this;
}
如需讨论可在issue回复。
The text was updated successfully, but these errors were encountered: