From 74a7a2bbef241a023110ff24c8e7c84025e267f5 Mon Sep 17 00:00:00 2001 From: qinxianzhangyao <11053546+qinxianzhangyao@user.noreply.gitee.com> Date: 星期四, 25 四月 2024 10:09:38 +0800 Subject: [PATCH] qxtj --- src/utils/index.js | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/src/utils/index.js b/src/utils/index.js index 0452ec7..c723cd1 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -389,3 +389,23 @@ return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str) } +export function getCurrentDomain() { + // /dev-api + // /prod-api + return window.location.protocol + '//' + window.location.host + "/prod-api" +} + +export function getQueryString(name) { + let reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i') + let r = window.location.search.substr(1).match(reg) // 鑾峰彇url涓�"?"绗﹀悗鐨勫瓧绗︿覆骞舵鍒欏尮閰� + let context = '' + if (r != null) context = r[2] + reg = null + r = null + return context == null || context == '' || context == 'undefined' ? '' : context +} + +export function removeHtmlTag(str) { + if (!str) return '' + return str.replace(/<[^>]+>/g, '').replaceAll(' ', '') +} \ No newline at end of file -- Gitblit v1.8.0