Skip to content

Commit 88b89cc

Browse files
committed
fix(layer): capi request with token
1 parent 567852f commit 88b89cc

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/modules/layer/apis/apis.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ function apiFactory(actions) {
1010
// RequestClient: 'ServerlessComponent',
1111
...inputs,
1212
};
13-
if (capi.options.Token) {
14-
data.Token = capi.options.Token;
15-
}
1613
try {
1714
const { Response } = await capi.request(
1815
data,
@@ -36,7 +33,7 @@ function apiFactory(actions) {
3633
}
3734
return Response;
3835
} catch (e) {
39-
throw new TypeError(`API_LAYER_${action}`, e.message, e.stack);
36+
throw new TypeError(`API_LAYER_${action}`, e.message, e.stack, e.reqId);
4037
}
4138
};
4239
});

src/modules/layer/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class Layer {
1010
Region: region,
1111
SecretId: credentials.SecretId,
1212
SecretKey: credentials.SecretKey,
13+
Token: credentials.Token,
1314
});
1415
this.cosClient = new Cos(credentials, region);
1516
}

0 commit comments

Comments
 (0)