(url, key)
| 2 | * 获取url的某个查询参数值 |
| 3 | */ |
| 4 | export function getQueryValue(url, key) { |
| 5 | const reg = new RegExp('(^|&|\\?)' + key + '=([^&]*)(&|$)'); |
| 6 | const match = reg.exec(url); |
| 7 | if (match && match.length >= 3) { |
| 8 | return match[2]; |
| 9 | } |
| 10 | return null; |
| 11 | } |
no test coverage detected