@@ -43,6 +43,55 @@ In the `extensions` section of the `config/admin.php` file, add some configurati
43
43
]
44
44
```
45
45
46
+ qnTokenUrl 接口的格式
47
+ 请求方式 GET,
48
+ 返回格式
49
+ ``` json
50
+ {
51
+ "uphost" : " https://up-z2.qiniup.com" , // 图片上传的地址
52
+ "domain" : " http://image.mmmx17.cn" , // 七牛的域名
53
+ "uptoken" : " xxxxxxxxx" // 上传图片需要的token
54
+ }
55
+ ```
56
+
57
+ 接口示例:
58
+ ``` php
59
+ // in controller
60
+ public function getQnToken()
61
+ {
62
+ $qnConfig = new Config();
63
+ $qnConfig->useHTTPS = env('IS_HTTPS_APP');
64
+ list($uphost, $error) = $qnConfig->getUpHostV2(config('filesystems.disks.qiniu.access_key') , config('filesystems.disks.qiniu.bucket'));
65
+ if($error) {
66
+ return [];
67
+ }
68
+ return [
69
+ 'uphost' => $uphost,
70
+ 'domain' => config('filesystem.disks.qiniu.domains.default'),
71
+ 'uptoken' => Storage::disk('qiniu')->getAdapter()->uploadToken()
72
+ ];
73
+ }
74
+
75
+ // in config/filesystems.php
76
+ ...
77
+ 'qiniu' =>
78
+ [
79
+ 'driver' => 'qiniu',
80
+ 'domains' => [
81
+ 'default' => 'http://image.mmmx17.cn', //你的七牛域名
82
+ 'https' => 'image.mmmx17.cn', //你的HTTPS域名
83
+ 'custom' => 'static.abc.com', //Useless 没啥用,请直接使用上面的 default 项
84
+ ],
85
+ 'access_key'=> env('QINIU_AK_KEY'), //AccessKey
86
+ 'secret_key'=> env('QINIU_SK_KEY'), //SecretKey
87
+ 'bucket' => 'mmmx17cn', //Bucket名字
88
+ 'notify_url'=> '', //持久化处理回调地址
89
+ 'access' => 'public', //空间访问控制 public 或 private
90
+ 'hotlink_prevention_key' => null, // CDN 时间戳防盗链的 key。 设置为 null 则不启用本功能。
91
+ ],
92
+ ...
93
+ ```
94
+
46
95
The configuration of the editor can be found in [ Simditor Documentation] ( https://simditor.tower.im/docs/doc-usage.html ) .
47
96
48
97
## Usage
0 commit comments