ant 獲取當前url的參數

在util.js 中封裝一個函數

公共函數:

import { parse } from 'querystring';
export const getPageQuery = () => parse(window.location.href.split('?')[1]);

例如當前url 爲:http://localhost:8000/manage/member_s_custome?corpId=ww02c137b227b01c99&userId=linli

需要取出來 corpId ,調用代碼:

import { getPageQuery } from '@/utils/utils';
console.log('getPageQuery().corpId',getPageQuery().corpId)

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章