@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.
- package/lib/app/lpk_devshell.js +1 -1
- package/lib/appstore/login.js +13 -5
- package/package.json +1 -1
package/lib/app/lpk_devshell.js
CHANGED
package/lib/appstore/login.js
CHANGED
|
@@ -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
|
-
|
|
117
|
-
await login(info.username, info.password);
|
|
125
|
+
await interactiveLogin();
|
|
118
126
|
}
|
|
119
127
|
|
|
120
128
|
export async function request(url, options = {}) {
|