dcat-vue icon indicating copy to clipboard operation
dcat-vue copied to clipboard

你这个七牛用的姿势好像不太对啊,协议没地方配置啊,默认http就报错了。

Open ieras opened this issue 3 years ago • 10 comments

如下: Mixed Content: The page at 'https://*****/admin/wp_posts/44/edit' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://up-cn-east-2.qiniup.com/'. This request has been blocked; the content must be served over HTTPS. 希望能改进一下! 另外为啥不用 zgldh/qiniu-laravel-storage 这个呢?感觉这个用的更多~

ieras avatar Dec 29 '22 17:12 ieras

如下: Mixed Content: The page at 'https://*****/admin/wp_posts/44/edit' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://up-cn-east-2.qiniup.com/'. This request has been blocked; the content must be served over HTTPS. 希望能改进一下! 另外为啥不用 zgldh/qiniu-laravel-storage 这个呢?感觉这个用的更多~

你的域名配置成https试试

weiwait avatar Dec 30 '22 01:12 weiwait

如下: Mixed Content: The page at 'https://*****/admin/wp_posts/44/edit' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://up-cn-east-2.qiniup.com/'. This request has been blocked; the content must be served over HTTPS. 希望能改进一下! 另外为啥不用 zgldh/qiniu-laravel-storage 这个呢?感觉这个用的更多~

你的域名配置成https试试

我看源码意思是这样,但是我怕配了还是请求http的七牛上传,配置如下 image

ieras avatar Dec 30 '22 01:12 ieras

大佬,可否开源一下前端代码啊?

ieras avatar Dec 30 '22 06:12 ieras

github仓库中有的

weiwait avatar Dec 30 '22 06:12 weiwait

github仓库中有的

我看都是压缩打包后的前端代码

ieras avatar Dec 30 '22 07:12 ieras

github仓库中有的

我看都是压缩打包后的前端代码

https://github.com/weiwait/dcat-vue-frontend

weiwait avatar Dec 30 '22 07:12 weiwait

github仓库中有的

我看都是压缩打包后的前端代码

https://github.com/weiwait/dcat-vue-frontend

谢谢

ieras avatar Dec 30 '22 07:12 ieras

七牛这里我改了一下代码,使用laravel内置的获取协议方法确定用http还是http 如果可以一起更新上吧!当然如果有更好的方法那更好一些!辛苦大佬啦

$config = new Config();
                $scheme = request()->server->get('REQUEST_SCHEME');
                $config->useHTTPS = ($scheme=='https');
                $url = $config->getUpHost(
                    config('filesystems.disks.qiniu.access_key'),
                    config('filesystems.disks.qiniu.bucket')
                );

ieras avatar Dec 30 '22 07:12 ieras

七牛这里我改了一下代码,使用laravel内置的获取协议方法确定用http还是http 如果可以一起更新上吧!当然如果有更好的方法那更好一些!辛苦大佬啦

$config = new Config();
                $scheme = request()->server->get('REQUEST_SCHEME');
                $config->useHTTPS = ($scheme=='https');
                $url = $config->getUpHost(
                    config('filesystems.disks.qiniu.access_key'),
                    config('filesystems.disks.qiniu.bucket')
                );

更新了

weiwait avatar Dec 30 '22 08:12 weiwait

Storage::disk('qiniu')->getAdapter()->getUploadToken($request['filename'], 3600); 咱们插件 没使用 zgldh/qiniu-laravel-storage 但是dcat-admin 文档里推荐使用的是 zgldh/qiniu-laravel-storage 这俩会造成冲突,会有如下报错,这应该是和laravel的扩展加载顺序有关

//Call to undefined method zgldh\\QiniuStorage\\QiniuAdapter::getUploadToken()

咱们是直连三方云,就是用到一个获取token的方法,真心建议直接沿用dcat-admin 推荐的那个扩展

Storage::disk('qiniu')->getAdapter()->uploadToken($request['filename'], 3600);

ieras avatar Jan 01 '23 13:01 ieras