@@ -23,20 +23,19 @@ const platformMap = {
2323 'WECHAT-PUBLIC' : '微信公众平台'
2424} ;
2525commander_1 . default
26- . command ( 'env:login:list [envId]' )
26+ . command ( 'env:login:list' )
27+ . option ( '-e, --envId <envId>' , '环境 Id' )
2728 . description ( '列出环境登录配置' )
28- . action ( function ( envId , options ) {
29+ . action ( function ( options ) {
2930 return __awaiter ( this , void 0 , void 0 , function * ( ) {
30- const { configFile } = options . parent ;
31+ const { envId , parent : { configFile } } = options ;
3132 const assignEnvId = yield utils_1 . getEnvId ( envId , configFile ) ;
3233 const configList = yield env_1 . getLoginConfigList ( {
3334 envId : assignEnvId
3435 } ) ;
3536 const head = [ '平台' , '平台 Id' , '创建时间' , '状态' ] ;
3637 const tableData = configList . map ( item => [
37- platformMap [ item . Platform ]
38- ? platformMap [ item . Platform ]
39- : item . Platform ,
38+ platformMap [ item . Platform ] ? platformMap [ item . Platform ] : item . Platform ,
4039 item . PlatformId ,
4140 item . CreateTime ,
4241 item . Status === 'ENABLE' ? '启用' : '禁用'
@@ -45,11 +44,12 @@ commander_1.default
4544 } ) ;
4645} ) ;
4746commander_1 . default
48- . command ( 'env:login:create [envId]' )
47+ . command ( 'env:login:create' )
48+ . option ( '-e, --envId <envId>' , '环境 Id' )
4949 . description ( '创建环境登录配置' )
50- . action ( function ( envId , options ) {
50+ . action ( function ( options ) {
5151 return __awaiter ( this , void 0 , void 0 , function * ( ) {
52- const { configFile } = options . parent ;
52+ const { envId , parent : { configFile } } = options ;
5353 const assignEnvId = yield utils_1 . getEnvId ( envId , configFile ) ;
5454 const { platform, status, appId, appSecret } = yield inquirer_1 . default . prompt ( [
5555 {
@@ -109,11 +109,12 @@ commander_1.default
109109 } ) ;
110110} ) ;
111111commander_1 . default
112- . command ( 'env:login:update [envId]' )
112+ . command ( 'env:login:update' )
113+ . option ( '-e, --envId <envId>' , '环境 Id' )
113114 . description ( '更新环境登录方式配置' )
114- . action ( function ( envId , options ) {
115+ . action ( function ( options ) {
115116 return __awaiter ( this , void 0 , void 0 , function * ( ) {
116- const { configFile } = options . parent ;
117+ const { envId , parent : { configFile } } = options ;
117118 const assignEnvId = yield utils_1 . getEnvId ( envId , configFile ) ;
118119 const configList = yield env_1 . getLoginConfigList ( {
119120 envId : assignEnvId
0 commit comments