param { string } url param { boolean } appendSource export function redirect ( url , appendSource = true ) { if ( appendSource ) { if ( url . indexOf ( '?' ) === - 1 ) { url = `${ url }?Source=${ encodeURIComponent ( document . location . href ) }` ; } else { url = `${ url }&Source=${ encodeURIComponent ( document . location . href ) }` ; } } document . location . href = url ; }