1. function params() {
    2. const search = window.location.search;
    3. search = search.substr(1, search.length);
    4. const res = {};
    5. if (!search) return res;
    6. search.split('&').map(item => {
    7. const [key, value] = item.split('=');
    8. res[key] = decodeURIComponent(value);
    9. });
    10. return res;
    11. }