From 3cd32552f60cca842a026b5a047e0ded85ad07df Mon Sep 17 00:00:00 2001 From: zhangds Date: Tue, 7 May 2024 09:53:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A2=9E=E5=8A=A0plan=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 11 ++++++++--- libs.js | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 3d96df6..c51add5 100644 --- a/index.html +++ b/index.html @@ -126,9 +126,14 @@ const GLOBAL_URL = window.location.href; // 当前url //获取链接携带的参数 let linkId = "1402"; // 设置默认落地页参数 - let keyCode = globalGetQueryString(GLOBAL_URL)[0]; - console.log(keyCode); - debugger + let keyCode = ""; // key码 + let URL_PARAMS = globalGetQueryString(GLOBAL_URL)[0]; // 获取 key 或者 id + if (!URL_PARAMS || URL_PARAMS === "") { + self.openErrorDialog("兑换链接错误"); + return + } + let plan_res = await req.axiosGet('/plan/plan_theme/' + URL_PARAMS); + console.log("plan_res =>", plan_res); return // === 通过接口获取 id和keycode diff --git a/libs.js b/libs.js index 3e9b7f1..8f979cc 100644 --- a/libs.js +++ b/libs.js @@ -94,6 +94,6 @@ const globalGetQueryString = (url) => { // 获取路径 const path = urlObj.pathname; // 分割路径 - const partsArr = path.split("/"); + const partsArr = path.split("/").filter((item) => item !== ""); return partsArr; };