Skip to content
New issue

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

3.0 获取统一默认配置建议加入$config=''的支持 #40

Open
hbh112233abc opened this issue Jun 18, 2019 · 0 comments
Open

3.0 获取统一默认配置建议加入$config=''的支持 #40

hbh112233abc opened this issue Jun 18, 2019 · 0 comments

Comments

@hbh112233abc
Copy link

vendor\topthink\think-captcha\src\Captcha.php 75行

/**
     * 配置验证码
     * @param string|null $config
     */
    protected function configure(string $config = null): void
    {
        if (is_null($config)) {
            $config = $this->config->get('captcha', []);
        } else {
            $config = $this->config->get('captcha.' . $config, []);
        }

        foreach ($config as $key => $val) {
            if (property_exists($this, $key)) {
                $this->{$key} = $val;
            }
        }
    }

当$config传入空字符串''即($config='')调用无法使用自定义的配置,建议支持空字符串获取默认配置

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant