stevenyangecho / laravel-u-editor

UEditor for laravel5. Support i18n. UEditor is a Rich Text Web Editor From Baidu.
MIT License
306 stars 79 forks source link

laravel5.5接入,上传图片到七牛云报错了 #52

Open 330132662 opened 6 years ago

330132662 commented 6 years ago

报错:

ErrorException: Trying to get property of non-object in file /home/vagrant/code/taoshu/vendor/qiniu/php-sdk/src/Qiniu/Config.php on line 44
Stack trace:
  1. ErrorException->() /home/vagrant/code/taoshu/vendor/qiniu/php-sdk/src/Qiniu/Config.php:44
  2. Illuminate\Foundation\Bootstrap\HandleExceptions->handleError() /home/vagrant/code/taoshu/vendor/qiniu/php-sdk/src/Qiniu/Config.php:44
  3. Qiniu\Config->getUpHost() /home/vagrant/code/taoshu/vendor/qiniu/php-sdk/src/Qiniu/Storage/FormUploader.php:58

报错位置代码:

public function getUpHost($accessKey, $bucket)
    {
        $zone = $this->getZone($accessKey, $bucket);
        if ($this->useHTTPS === true) {
            $scheme = "https://";
        } else {
            $scheme = "http://";
        }

        $host = $zone->srcUpHosts[0];// 这就是第44行了~
        if ($this->useCdnDomains === true) {
            $host = $zone->cdnUpHosts[0];
        }

        return $scheme . $host;
    }
330132662 commented 6 years ago

补充:

//七牛配置,若mode='qiniu',以下为必填.
        'qiniu' => [
            'accessKey' => 'SVr78LLP090RmTTqEm2&********',
            'secretKey' => 'D4ZdNo_7pHfzNTQufY*******',
            'bucket' => '', 
            'url' => 'http://********.com1.z0.glb.clouddn.com',//七牛分配的CDN域名,注意带上http://

这是配置页,里面的bucket我找不到在哪儿 是不是因为这个没填呢?

vtanrun commented 6 years ago

登陆七牛云控制台不就能找到bucket么? 没有这个 bucket 好像生成不了正确的七牛up token

yushengbuilder commented 5 years ago

同样的报错,还没有解决