Skip to content

Commit 1af8ec1

Browse files
committed
fix(asw): create get appId
1 parent 7957826 commit 1af8ec1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/modules/asw/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,14 @@ export default class Asw {
8989
};
9090

9191
let roleName = role;
92-
const { appId, ownerUin } = await this.account.get();
92+
const accountInfo = await this.account.get();
9393

9494
if (!roleName) {
95-
roleName = await this.createRole(name, appId);
95+
// 如果上层传入 appId 直接使用上层 appId,如果没有尝试通过 accountInfo 中来获取
96+
const appId = options.appId || accountInfo.appId;
97+
roleName = await this.createRole(name, appId!);
9698
}
97-
reqParams.RoleResource = `qcs::cam::uin/${ownerUin}:roleName/${roleName}`;
99+
reqParams.RoleResource = `qcs::cam::uin/${accountInfo.ownerUin}:roleName/${roleName}`;
98100

99101
if (input) {
100102
reqParams.Input = input;

0 commit comments

Comments
 (0)