Skip to content

Commit 2929045

Browse files
author
liaojiawei
committed
feat: 支持pvl
1 parent 68bb9f3 commit 2929045

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ossutil*
1515
.ossutil_checkpoint
1616
ossutil_output
1717
app.asar
18-
18+
pvl
1919

2020
#tool
2121
.vscode/

app/components/services/oss2.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ angular.module('web').factory('ossSvs2', [
127127
if (Object.prototype.hasOwnProperty.call(options, 'securityToken')) {
128128
final.stsToken = options.securityToken;
129129
}
130-
console.log("client3 options", final);
131130

132131
const client = new AliOSS(final);
133132

vendor/aliyun-sdk-oss.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,8 @@ ALY.Config = ALY.util.inherit({
806806
computeChecksums: true,
807807
securityToken: '',
808808
cname: false,
809-
isRequestPayer: false
809+
isRequestPayer: false,
810+
sldEnable:false
810811
}
811812
});
812813

@@ -3858,6 +3859,7 @@ ALY.OSS = ALY.Service.defineService('oss', ['2013-10-15'], {
38583859
populateURI: function populateURI(req) {
38593860
var httpRequest = req.httpRequest;
38603861
var b = req.params.Bucket;
3862+
var sldEnable=(typeof this==="object")&&(typeof this.service==="object")&&(typeof this.service.config==="object")&&(this.service.config.sldEnable===true);
38613863

38623864
if (b) {
38633865
// support cname
@@ -3873,10 +3875,11 @@ ALY.OSS = ALY.Service.defineService('oss', ['2013-10-15'], {
38733875
return
38743876
}
38753877

3876-
// is IP
3878+
// is not IP
38773879
if(!req.service.hostIsIP(httpRequest.endpoint.hostname)){
38783880
// 确保 host 只被 set 一次,因为 endpoint 只在 service 唯一
3879-
httpRequest.endpoint.host = httpRequest.endpoint.hostname = b + '.' + httpRequest.endpoint.hostname;
3881+
var endpoint=sldEnable?`${httpRequest.endpoint.hostname}/${b}`:`${b}.${httpRequest.endpoint.hostname}`
3882+
httpRequest.endpoint.host = httpRequest.endpoint.hostname = endpoint;
38803883
httpRequest.virtualHostedBucket = b;
38813884
httpRequest.path = httpRequest.path.replace(new RegExp('^/' + b), '');
38823885
}

0 commit comments

Comments
 (0)