Skip to content

Commit 00ba5c2

Browse files
committed
chore: optimize example code
1 parent de4453f commit 00ba5c2

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

Example/App.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,22 @@ import { BucketManager } from './Component/BucketManager'
1414
import { ObjectManager } from './Component/ObjectManager'
1515

1616
import AliyunOSS from 'aliyun-oss-react-native'
17+
1718
//open log
1819
AliyunOSS.enableDevMode()
20+
1921
// defalut configraiton
2022
const configuration = {
2123
maxRetryCount: 3,
2224
timeoutIntervalForRequest: 30,
2325
timeoutIntervalForResource: 24 * 60 * 60
2426
};
25-
const config = {
26-
AccessKey: 'XXX',
27-
SecretKey: 'XXX',
28-
};
29-
const endPoint = 'oss-cn-zhangjiakou.aliyuncs.com';
30-
const companyserver = "http://XXX:PORT";
31-
const familyserver = "http://XXX:PORT";
3227

33-
// AliyunOSS.initWithPlainTextAccessKey(config.AccessKey, config.SecretKey, endPoint, configuration);
34-
AliyunOSS.initWithServerSTS(familyserver,endPoint, configuration)
28+
const endPoint = 'oss-cn-XXX.aliyuncs.com';
29+
const authserver = "http://XXX:PORT";
30+
31+
// initWithServerSTS to auth
32+
AliyunOSS.initWithServerSTS(authserver,endPoint, configuration)
3533

3634
type Props = {};
3735

Example/Component/AuthManager.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import {
1212

1313

1414
const configuration = {
15-
maxRetryCount: 3,
16-
timeoutIntervalForRequest: 30,
17-
timeoutIntervalForResource: 24 * 60 * 60
15+
maxRetryCount: 3,
16+
timeoutIntervalForRequest: 30,
17+
timeoutIntervalForResource: 24 * 60 * 60
1818
};
1919

2020
const config = {

0 commit comments

Comments
 (0)