From 510f24bd90c89156172b156c2b48434b309ea237 Mon Sep 17 00:00:00 2001 From: wangyaqi Date: Mon, 17 Oct 2022 20:10:28 +0800 Subject: [PATCH] fix: url log error --- packages/uni-cli-shared/src/hbx/log.ts | 2 +- packages/vite-plugin-uni/src/cli/server.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/uni-cli-shared/src/hbx/log.ts b/packages/uni-cli-shared/src/hbx/log.ts index bd979fd10..3f79fb8d0 100644 --- a/packages/uni-cli-shared/src/hbx/log.ts +++ b/packages/uni-cli-shared/src/hbx/log.ts @@ -83,7 +83,7 @@ export const h5ServeFormatter: Formatter = { if (networkLogs.length) { // 延迟打印所有 network,仅最后一个 network 替换 ➜ 为 -,通知 hbx const len = networkLogs.length - 1 - networkLogs[len] = networkLogs[len].replace('➜', '-') + networkLogs[len] = networkLogs[len].replace('* Network', '- Network') console.log(networkLogs.join('\n')) networkLogs.length = 0 } diff --git a/packages/vite-plugin-uni/src/cli/server.ts b/packages/vite-plugin-uni/src/cli/server.ts index 4c4401d8e..fc923b1f6 100644 --- a/packages/vite-plugin-uni/src/cli/server.ts +++ b/packages/vite-plugin-uni/src/cli/server.ts @@ -204,7 +204,7 @@ function printServerUrls( .map((detail) => { const type = detail.address.includes('127.0.0.1') ? ' - Local: ' - : ' - Network: ' + : ' * Network: ' const host = detail.address.replace('127.0.0.1', hostname.name) const url = `${protocol}://${host}:${colors.bold(port)}${base}` return `${type} ${colors.cyan(url)}` @@ -214,7 +214,7 @@ function printServerUrls( }) .forEach((msg, index, arr) => { if (arr.length - 1 === index) { - info(msg.replace('➜', '-')) + info(msg.replace('* Network', '- Network')) } else { info(msg) } -- GitLab