From 1bd67a6ea7a9a2b62660fabbd00de04b2b974ccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=94=E8=B7=91=E7=9A=84=E9=9D=A2=E6=9D=A1?= <1262327911@qq.com> Date: Sat, 12 Nov 2022 16:10:14 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E8=BD=AC=E7=A7=BBmaster-fetch?= =?UTF-8?q?=E5=88=86=E6=94=AF=E8=8E=B7=E5=8F=96id=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E5=88=B0dev=E5=88=86=E6=94=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/router.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/utils/router.ts b/src/utils/router.ts index f2bf6142..f2a9c696 100644 --- a/src/utils/router.ts +++ b/src/utils/router.ts @@ -153,6 +153,19 @@ export const fetchRouteParams = () => { } } +/** + * * 通过硬解析获取当前路由下的参数 + * @returns object + */ + export const fetchRouteParamsLocation = () => { + try { + return document.location.hash.split('/').pop() || '' + } catch (error) { + window['$message'].warning('查询路由信息失败,请联系管理员!') + return '' + } +} + /** * * 回到主页面 * @param confirm