Commit 424f2169 by zhaochengxiang

url获取

parent f0b64d4a
...@@ -200,7 +200,7 @@ export const getQueryParam = (param, url) => { ...@@ -200,7 +200,7 @@ export const getQueryParam = (param, url) => {
//eslint-disable-next-line //eslint-disable-next-line
const name = param.replace(/[\[\]]/g, '\\$&') const name = param.replace(/[\[\]]/g, '\\$&')
const regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)') const regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)')
const results = regex.exec(url) const results = regex.exec(window?.location?.href)
if (!results) return null if (!results) return null
if (!results[2]) return '' if (!results[2]) return ''
return decodeURIComponent(results[2].replace(/\+/g, ' ')) return decodeURIComponent(results[2].replace(/\+/g, ' '))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment