From bad2bc143be3f8ddb93a1c9f984127b3ccf43e8f Mon Sep 17 00:00:00 2001
From: lkk <364857242@qq.com>
Date: 星期一, 31 三月 2025 17:47:14 +0800
Subject: [PATCH] 11

---
 src/utils/index.js |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/src/utils/index.js b/src/utils/index.js
index 4e65504..c723cd1 100644
--- a/src/utils/index.js
+++ b/src/utils/index.js
@@ -376,6 +376,7 @@
 
 // 棣栧瓧姣嶅ぇ灏�
 export function titleCase(str) {
+  console.log(str.replace(/( |^)[a-z]/g, L => L.toUpperCase()))
   return str.replace(/( |^)[a-z]/g, L => L.toUpperCase())
 }
 
@@ -388,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('&nbsp;', '')
+}
\ No newline at end of file

--
Gitblit v1.8.0