@cloudbase/toolbox 0.7.16-beta.2 → 0.7.16
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/web/web.js +2 -4
- package/package.json +1 -1
package/lib/web/web.js
CHANGED
|
@@ -99,8 +99,6 @@ function openUrl(url) {
|
|
|
99
99
|
const child = yield (0, open_1.default)(url, { url: true });
|
|
100
100
|
if (child === null || child === void 0 ? void 0 : child.once) {
|
|
101
101
|
child.once('error', (error) => __awaiter(this, void 0, void 0, function* () {
|
|
102
|
-
const code = (error === null || error === void 0 ? void 0 : error.code) || 'UNKNOWN';
|
|
103
|
-
console.warn(`自动打开浏览器失败(${code})。`);
|
|
104
102
|
if (shouldUseBrowserEnvFallback()) {
|
|
105
103
|
yield openUrlByBrowserEnv(url);
|
|
106
104
|
}
|
|
@@ -127,8 +125,8 @@ function getDataFromWeb(getUrl, type, options = {}) {
|
|
|
127
125
|
throw new error_1.CloudBaseError('callbackTimeout must be a positive number');
|
|
128
126
|
}
|
|
129
127
|
const url = getUrl(port);
|
|
130
|
-
console.log('\n\n
|
|
131
|
-
console.log(`\n${url}`);
|
|
128
|
+
console.log('\n\n若链接未自动打开,请手动复制至浏览器,或尝试其他登录方式:');
|
|
129
|
+
console.log(`\n${url}\n`);
|
|
132
130
|
if (!noBrowser) {
|
|
133
131
|
// 对 url 转码, 避免 wsl 无法正常打开地址
|
|
134
132
|
// https://www.npmjs.com/package/open#url
|