Add secret to download file when refreshing robot secret (#16565)

Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
孙世军 2022-03-22 17:21:31 +08:00 committed by GitHub
parent e0ecd1beb1
commit 9b8482a1b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,6 +90,7 @@ export class ViewTokenComponent implements OnInit {
this.copyToken = true;
this.createSuccess = 'SYSTEM_ROBOT.REFRESH_SECRET_SUCCESS';
// export to token file
robot.secret = res.secret;
const downLoadUrl = `data:text/json;charset=utf-8, ${encodeURIComponent(JSON.stringify(robot))}`;
this.downLoadHref = this.sanitizer.bypassSecurityTrustUrl(downLoadUrl);
this.downLoadFileName = `${robot.name}.json`;