路由获取参数

引用地址

案例
http://192.168.0.107:9528/?token=c3fa66266eab4b89a693f3e24a0547e3&system=aaa#/dashboard
import { urlGet } from '@/utils/index'

引用方法

  const $_GET = urlGet()
  $_GET['token']
$_GET['system']
````````````````````````

## utils/index'
```````````````
/**
 * @param {string} url
 * @returns {Object}
 */
export function urlGet() {
  var parts = window.location.search.substr(1).split('&')
  var $_GET = {}
  for (var i = 0; i < parts.length; i++) {
    var temp = parts[i].split('=')
    $_GET[decodeURIComponent(temp[0])] = decodeURIComponent(temp[1])
  }
  return $_GET
}
````````````````````

你可能感兴趣的:(路由获取参数)