@lazycatcloud/lzc-cli 1.2.14 → 1.2.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -420,7 +420,7 @@ class DevShell {
420
420
  // 检查rsync工具是否存在:提示用户
421
421
  const rsyncExisted = commandExists.sync("rsync");
422
422
  if (!rsyncExisted) {
423
- console.log(chalk.red("请检查 rsync 是否安装,路径是否正确!"));
423
+ logger.error("请检查 rsync 是否安装,路径是否正确!");
424
424
  process.exit(1);
425
425
  }
426
426
 
@@ -83,6 +83,17 @@ async function askUserInfo() {
83
83
  ]);
84
84
  }
85
85
 
86
+ async function interactiveLogin() {
87
+ try {
88
+ let info = await askUserInfo();
89
+ await login(info.username, info.password);
90
+ } catch (e) {
91
+ logger.debug("login error: ", e);
92
+ logger.info("帐号或者密码错误,请重新输入!");
93
+ return interactiveLogin();
94
+ }
95
+ }
96
+
86
97
  export async function reLogin() {
87
98
  let token = await isLogin();
88
99
  if (token) {
@@ -100,9 +111,7 @@ export async function reLogin() {
100
111
  return;
101
112
  }
102
113
  }
103
-
104
- let info = await askUserInfo();
105
- await login(info.username, info.password);
114
+ await interactiveLogin();
106
115
  }
107
116
 
108
117
  export async function autoLogin() {
@@ -113,8 +122,7 @@ export async function autoLogin() {
113
122
  }
114
123
 
115
124
  logger.debug("token错误,尝试自动登录");
116
- let info = await askUserInfo();
117
- await login(info.username, info.password);
125
+ await interactiveLogin();
118
126
  }
119
127
 
120
128
  export async function request(url, options = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lazycatcloud/lzc-cli",
3
- "version": "1.2.14",
3
+ "version": "1.2.15",
4
4
  "description": "lazycat cloud developer kit",
5
5
  "files": [
6
6
  "template",