认证后如何获得JWT令牌?

时间:2018-11-16 22:43:47

标签: reactjs spring-boot jwt

我有一个Rest spring-boot API,当用户对api进行身份验证时,该API返回令牌jwt,我在浏览器中注意到该令牌出现在Response Header> Authentication中,并且在带有Postman的测试中它显示在主体中

我如何通过Reactjs将该令牌存储在本地存储浏览器中?

我发出请求的代码如下:

A process can host a TLS callback, and then it will receive notifications of thread creation. That can intercept thread creation such as what is produced by CreateRemoteThread. If the thread start address is LoadLibrary(), then you have a good indication that someone is about to force-load a DLL.

1 个答案:

答案 0 :(得分:0)

///将数据保存到当前的本地存储中

 localStorage.setItem("username", "John");

//访问一些存储的数据

alert( "username = " + localStorage.getItem("username"));

setitem的第一个参数是键

我的帐户受到一些否决问题的阻止,有趣的是,即使我已经接受了答案,我也必须重新编辑它们。我不明白这样做的意义。这个stackoverflow系统。

现在,除了继续编辑我的问题外,我基本上无能为力,并且所有问题都已得到解答。这太荒谬了!!!

相关问题