@@ -13,6 +13,7 @@ import {
1313 getAuthorizerListWithAllDetail ,
1414 getClientsConfig ,
1515 getPreAuthQrCode ,
16+ getTester ,
1617 getTrialQrCode ,
1718 unbindTester ,
1819 undoAudit
@@ -54,7 +55,7 @@ program.action(async (miniprogram: string, opt: GitmMiniprogramOption): Promise<
5455 )
5556 ; [ , miniprogram = '' ] = await to (
5657 select < string > ( {
57- message : t ( 'Select the application to build ' ) ,
58+ message : t ( 'Select miniprogram ' ) ,
5859 choices : list . map ( ( { authorizer_info : info , authorizer_appid } ) => ( {
5960 name : info . nick_name ,
6061 value : authorizer_appid
@@ -67,7 +68,7 @@ program.action(async (miniprogram: string, opt: GitmMiniprogramOption): Promise<
6768
6869 const [ , action = '' ] = await to (
6970 select < string > ( {
70- message : t ( 'Please select the operation you want?' ) ,
71+ message : t ( 'Select the operation you want?' ) ,
7172 choices : [
7273 new Separator ( ' === 1. ' + t ( 'Audit' ) + ' === ' ) ,
7374 {
@@ -150,15 +151,27 @@ program.action(async (miniprogram: string, opt: GitmMiniprogramOption): Promise<
150151 sh . echo ( chalk . green ( t ( 'Implementation success' ) ) )
151152 }
152153 } else if ( action === 'unbind_tester' ) {
154+ const [ , list = [ ] ] = await to ( getTester ( miniprogram ) )
153155 const [ , userstr = '' ] = await to (
154- input ( {
155- message : t ( 'Enter wechat userstr' ) ,
156- transformer : val => val . trim ( )
157- } ) . then ( val => val . trim ( ) )
156+ select < string > ( {
157+ message : t ( 'Select wechat account' ) ,
158+ choices : list . map ( ( { userstr } ) => ( {
159+ name : userstr ,
160+ value : userstr
161+ } ) )
162+ } )
158163 )
159164 if ( userstr ) {
160- await unbindTester ( { userstr, authorizer_appid : miniprogram } )
161- sh . echo ( chalk . green ( t ( 'Implementation success' ) ) )
165+ const [ , answer ] = await to (
166+ confirm ( {
167+ message : t ( 'Confirm unbind wechat account' ) ,
168+ default : false
169+ } )
170+ )
171+ if ( answer ) {
172+ await unbindTester ( { userstr, authorizer_appid : miniprogram } )
173+ sh . echo ( chalk . green ( t ( 'Implementation success' ) ) )
174+ }
162175 }
163176 }
164177} )
0 commit comments