如何在核心php应用程序中使用节点js json web令牌库

时间:2016-05-03 12:36:33

标签: javascript node.js json-web-token

<script type="text/javascript" src="node_modules/requirejs/require.js">  </script>
<script type="text/javascript" src="node_modules/jws/index.js"></script>
<script type="text/javascript" src="node_modules/jsonwebtoken/index.js"></script>
<script>
var jwt = require('jsonwebtoken');
</script>

代码完成如上,但我们仍然遇到以下错误。

未捕获错误:模块名称&#34; lib / sign-stream&#34;尚未加载上下文:_。使用require([]) 未捕获错误:模块名称&#34; jws&#34;尚未加载上下文:_。使用require([]) 未捕获错误:模块名称&#34; jsonwebtoken&#34;尚未加载上下文:_。使用require([])

请帮我解决这个问题。

1 个答案:

答案 0 :(得分:0)

JWT不是Node.js特定的,你可以使用它与很多语言的PHP使用php-jwt