From 2cb65d99c9aebf8293cb2838fcfe3e09fb2739ce Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 06 十二月 2019 00:15:12 +0800 Subject: [PATCH] 2019-12-06 --- src/utils/utils.js | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/utils/utils.js b/src/utils/utils.js index a312464..53cb3b8 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -1,5 +1,7 @@ import moment from 'moment' +const service = window.GLOB.service ? (/\/$/.test(window.GLOB.service) ? window.GLOB.service : window.GLOB.service + '/') : '' + export default class Utils { /** * @description 鐢熸垚32浣島uid string + 鏃堕棿 @@ -138,6 +140,7 @@ let reg = new RegExp('(^|\\s)' + item.key + '(\\s|$)', 'ig') value = value.replace(reg, item.value) }) + value = value.replace(/%/ig, 'mpercent') value = value.replace(/(^\s|\s$)/ig, '') value = window.btoa(window.encodeURIComponent(value)) let index = Math.floor(Math.random() * value.length) @@ -261,9 +264,9 @@ if (!url) return '' let baseurl = '' if (process.env.NODE_ENV === 'production') { - baseurl = document.location.origin + '/' + baseurl = document.location.origin + '/' + service } else { - baseurl = 'http://qingqiumarket.cn/MKWMS/' + baseurl = 'http://qingqiumarket.cn/' + service } let realurl = url.match(/^http/) || url.match(/^\/\//) ? url : baseurl + url return realurl -- Gitblit v1.8.0