11import { localize } from "vscode-nls-i18n" ;
22import { ExtensionContext , workspace , ConfigurationTarget , window } from "vscode" ;
3- import { terraformShellManager } from "../../../client/terminal/terraformShellManager" ;
4- import { AbstractClient } from "tencentcloud-sdk-nodejs/tencentcloud/common/abstract_client" ;
5- import { Credential } from "tencentcloud-sdk-nodejs/tencentcloud/common/interface" ;
63
74import { container } from "../../container" ;
85import { Context } from "../../context" ;
96import { tree } from "../treeDataProvider" ;
107import { getCredentailByInput } from "./auth" ;
8+ import { LoginProvider } from "../../../views/login/loginExplorer" ;
9+ import { terraformShellManager } from "../../../client/terminal/terraformShellManager" ;
1110
1211export namespace user {
1312 interface UserInfo {
@@ -39,13 +38,11 @@ export namespace user {
3938 // set in vscode configuration(setting.json)
4039 config . update ( 'tcTerraform.properties.secretId' , accessKey , ConfigurationTarget . Global )
4140 . then ( ( ) => {
42- window . showInformationMessage ( '设置secretId成功' ) ;
4341 } , ( error ) => {
4442 window . showErrorMessage ( '设置secretId失败: ' + error ) ;
4543 } ) ;
4644 config . update ( 'tcTerraform.properties.secretKey' , secretKey , ConfigurationTarget . Global )
4745 . then ( ( ) => {
48- window . showInformationMessage ( '设置secretKey成功' ) ;
4946 } , ( error ) => {
5047 window . showErrorMessage ( '设置secretKey失败: ' + error ) ;
5148 } ) ;
@@ -54,6 +51,9 @@ export namespace user {
5451 process . env . TENCENTCLOUD_SECRET_ID = accessKey ;
5552 process . env . TENCENTCLOUD_SECRET_KEY = secretKey ;
5653
54+ terraformShellManager . getShell ( ) . runNormalCmd ( "export TENCENTCLOUD_SECRET_ID=" + accessKey ) ;
55+ terraformShellManager . getShell ( ) . runNormalCmd ( "export TENCENTCLOUD_SECRET_KEY=" + secretKey ) ;
56+
5757 tree . refreshTreeData ( ) ;
5858 window . showInformationMessage ( localize ( "TcTerraform.login.success" ) ) ;
5959 }
0 commit comments