js解析jwt中的数据
Others 2020-12-02 06:44:46 2020-12-02 06:44:46 1595 次浏览var token='eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ7XCJzYWx0XCI6XCJpYW1cIixcIm5hbWVcIjpcImFkbWluXCIsXCJ1c2VyTmFtZVwiOlwiYWRtaW5cIixcInN0YXR1c1wiOlwiRU5BQkxFRFwifSIsImV4cCI6MTYwNjg5MjE2OSwiaWF0IjoxNjA2ODkxMzA1fQ.j9E9v4SKIY4Fd49ywHiEvU3Ie163VR9GXSpf4lNBKjs'; let strings = token.split(".");
console.log(JSON.parse(decodeURIComponent(escape(window.atob(strings[1].replace(/-/g, "+").replace(/_/g, "/"))))))
Links: 492