From 5fb65ada8ccc28eabf823b284de70fbd3ca1f41e Mon Sep 17 00:00:00 2001 From: ZZJ <zzjdsg2300@163.com> Date: 星期二, 28 九月 2021 18:29:36 +0800 Subject: [PATCH] 抓拍大图层级修复v1 --- src/api/utils.ts | 22 +++++++++++++--------- 1 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/api/utils.ts b/src/api/utils.ts index b7f92c3..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,12 +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