📅  最后修改于: 2022-03-11 15:02:14.480000             🧑  作者: Mango
// Get query string from url
const href = 'http://localhost:8080/sign-up?ref=devjohndoe'
const referral_token = new URL(href).search.split('?ref=').pop();
console.log(referral_token);