File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -142,12 +142,14 @@ export default class Asw {
142142 } ;
143143
144144 let roleName = role ;
145- const { appId , ownerUin } = await this . account . get ( ) ;
145+ const accountInfo = await this . account . get ( ) ;
146146
147147 if ( ! roleName ) {
148- roleName = await this . createRole ( name , appId ) ;
148+ // 如果上层传入 appId 直接使用上层 appId,如果没有尝试通过 accountInfo 中来获取
149+ const appId = options . appId || accountInfo . appId ;
150+ roleName = await this . createRole ( name , appId ! ) ;
149151 }
150- reqParams . RoleResource = `qcs::cam::uin/${ ownerUin } :roleName/${ roleName } ` ;
152+ reqParams . RoleResource = `qcs::cam::uin/${ accountInfo . ownerUin } :roleName/${ roleName } ` ;
151153
152154 if ( input ) {
153155 reqParams . Input = input ;
Original file line number Diff line number Diff line change @@ -43,6 +43,9 @@ export interface CreateOptions {
4343 enableCls ?: boolean ;
4444 // 状态机默认输入参数
4545 input ?: string ;
46+
47+ // app id
48+ appId ?: string ;
4649}
4750
4851export interface UpdateOptions extends CreateOptions {
You can’t perform that action at this time.
0 commit comments