0

我很绝望。。

在我的 ionic2 项目上安装了 npm 包:“angular2-jwt”:“^0.1.28”。(我正在使用 IntelliJ)

当我运行“离子服务”时,我得到:

Runtime Error
Error in ./MyApp class MyApp - caused by: token.split is not a function

TypeError: token.split is not a function
    at JwtHelper.decodeToken (angular2-jwt.js:221)

我在 angular2-jws.js 中看到:

var parts = token.split('.');

split 有多个声明(EcmaScript.js 和 EcmaScript6.js)。

我还尝试在“设置”>“语言和框架”>“JavaScript”下更改 JavaScript 语言版本并再次提供服务,但没有成功。

相同的代码适用于使用 Visual Studio Code 的 Angular2 项目。

如果有人能给我一个提示,那就太酷了..

4

0 回答 0