From cbb9d1dce2698b02e4e5fdffd342ed72cfc50939 Mon Sep 17 00:00:00 2001 From: Tevin <tingquanren@163.com> Date: Mon, 15 Mar 2021 16:36:25 +0800 Subject: [PATCH] 实现 h5 开发中 rem 转换 px --- bases/Fetcher.js | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bases/Fetcher.js b/bases/Fetcher.js index f227744..8392590 100644 --- a/bases/Fetcher.js +++ b/bases/Fetcher.js @@ -540,13 +540,13 @@ if (sever && typeof project.host.hosts[sever] !== 'undefined') { return project.host.hosts[sever]; } - // 使用设置的默认服务器地址 + // 网页域名提取服务器地址 + else if (window.location.protocol.indexOf('http') >= 0) { + return window.location.protocol + '//' + window.location.host; + } + // 非 http 协议打开时,使用设置的服务器地址 else if (project.host.server) { return project.host.server; - } - // 网页域名提取服务器地址 - else { - return window.location.protocol + '//' + window.location.host; } } } -- Gitblit v1.9.1