Skip to content
This repository was archived by the owner on Mar 4, 2018. It is now read-only.

Commit 42203a3

Browse files
committed
七牛多分区支持
1 parent 7555c9b commit 42203a3

File tree

4 files changed

+30
-6
lines changed

4 files changed

+30
-6
lines changed

admin/add_policy.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,26 @@
479479
</div>
480480

481481
</div>
482+
<div style="height:10px;"></div>
483+
<div class="row">
484+
<div class="col-lg-2" align="right">
485+
<label class="lab">储存区:</label>
486+
</div>
487+
<div class="col-lg-5" align="right">
488+
<select name="p_server" class="form-control">
489+
490+
<option value ="https://up.qbox.me">华东区(https://up.qbox.me)</option>
491+
<option value ="https://up-z1.qbox.me">华北区(https://up-z1.qbox.me)</option>
492+
<option value ="https://up-z2.qbox.me">华南区(https://up-z2.qbox.me)</option>
493+
<option value ="https://up-na0.qbox.me">北美区(https://up-na0.qbox.me)</option>
494+
</select>
495+
496+
</div>
497+
<div class="col-lg-3" align="right">
498+
<div class="sm" align="left">可在七牛后台查看或创建空间时选择。请正确填写,否则无法上传。</div>
499+
</div>
500+
501+
</div>
482502
<div style="height:10px;"></div>
483503
<div class="row">
484504
<div class="col-lg-2" align="right">

content/themes/material/js/qiniu.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ function QiniuJsSDK() {
216216
return key;
217217
};
218218
plupload.extend(option, op, {
219-
url:"https://up.qbox.me",
219+
url:upserver,
220220
multipart_params:{
221221
token:""
222222
}
@@ -318,7 +318,7 @@ function QiniuJsSDK() {
318318
}
319319
}
320320
up.setOption({
321-
url:"https://up.qbox.me/mkblk/" + blockSize,
321+
url:upserver+"/mkblk/" + blockSize,
322322
multipart:false,
323323
chunk_size:chunk_size,
324324
required_features:"chunks",
@@ -340,7 +340,7 @@ function QiniuJsSDK() {
340340
chunk_size = chunk_size || up.settings && up.settings.chunk_size;
341341
if (leftSize < chunk_size) {
342342
up.setOption({
343-
url:"https://up.qbox.me/mkblk/" + leftSize
343+
url:upserver+"/mkblk/" + leftSize
344344
});
345345
}
346346
localStorage.setItem(file.name, JSON.stringify({
@@ -515,7 +515,7 @@ function QiniuJsSDK() {
515515
}
516516
}
517517
}
518-
var url = "https://up.qbox.me/mkfile/" + file.size + key + x_vars_url;
518+
var url = upserver+"/mkfile/" + file.size + key + x_vars_url;
519519
var ajax = that.createAjax();
520520
ajax.open("POST", url, true);
521521
ajax.setRequestHeader("Content-Type", "text/plain;charset=UTF-8");

includes/adminAction.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@
4545
$policyname=$_POST['policyname'];
4646
$policytype=$_POST['policytype'];
4747
$kjm=$_POST['kjm'];
48-
$p_server = $_POST['p_server_method'] == "http://" ? "http://".$_POST['p_server']."/" : "https://".$_POST['p_server']."/";
48+
if($policytype == "qiniu"){
49+
$p_server = $_POST["p_server"];
50+
}else{
51+
$p_server = $_POST['p_server_method'] == "http://" ? "http://".$_POST['p_server']."/" : "https://".$_POST['p_server']."/";
52+
}
4953
$p_dir=$_POST['p_dir'];
5054
$namerule=$_POST['namerule'];
5155
$zzurl=$_POST['zzurl'];

index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
}
5151
}else{
5252
$fileType = 'var min="'.$fileType.'"';
53-
$upServer = "https://up.qbox.me";
53+
$upServer = $serverUrl;
5454
$filePart = "4";
5555
}
5656
$smarty->template_dir = "content/themes/".$theme;

0 commit comments

Comments
 (0)