SOURCE

function getQueryString(name,aa) {
  var reg = new RegExp('(^|&|\\?)' + name + '=([^&]*)(&|$)', 'i')
  var r = aa.match(reg)
  if (r != null) {
    return unescape(r[2])
  }
  return null
}
const rr = 'http://10.230.0.57:9008/?flag=30a289202229427995c8ca8719bed615&code=KkPOBY&state=49,eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NDU2ODE1ODksInVzZXJfbmFtZSI6Im5ucyIsImp0aSI6IjI5N2Y3YmY3LWI5NmUtNDBlOS1iYjU5LTVjMWJkNGY2M2NhNyIsImNsaWVudF9pZCI6IlR6RnlqMG96ejRnT1ZpRUIiLCJzY29wZSI6WyJkZWZhdWx0Il0sInVzZXJuYW1lIjoibm5zIn0.8RcsxWwQY4sNOoQbpF3u4bwgk3f_TZpSaJUnR4XQR_A'
console.log(getQueryString('state', rr))
console 命令行工具 X clear

                    
>
console