From 4b43bfb3f6f499f480712dd29bef52275466afd6 Mon Sep 17 00:00:00 2001 From: heyujie <516346543@qq.com> Date: 星期五, 30 七月 2021 22:10:59 +0800 Subject: [PATCH] change all --- src/api/utils.ts | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/api/utils.ts b/src/api/utils.ts index 5b90c14..1088596 100644 --- a/src/api/utils.ts +++ b/src/api/utils.ts @@ -1,5 +1,4 @@ import request from "@/scripts/httpRequest"; -import qs from "qs"; // 鑾峰彇鑿滃崟鏁版嵁 export const getMenuListData = (query: any) => { @@ -32,16 +31,17 @@ } } } -// 鏁扮粍鍘婚噸-1鏍囪瘑鏈壘鍒� -export const findInArr = (n: any, arr: any) => { - for (let i = 0; i < arr.length; i++) { - if (arr[i] === n) { - return i - } - } - return -1 -} export const pad0 = (val: Number) => { return val < 10 ? "0" + val : val; } + +export const getUrlKey = (name: String) => { + return ( + decodeURIComponent( + (new RegExp("[?|&]" + name + "=" + "([^&;]+?)(&|#|;|$)").exec( + location.href + ) || [, ""])[1].replace(/\+/g, "%20") + ) || null + ); +} -- Gitblit v1.8.0