我在用Angular4编写的应用程序中遇到此错误,但是我无法弄清楚这是什么意思。
这是堆比赛:
content.js:92 invalid bearer token, token= null
_callee3$ @ content.js:92
tryCatch @ runtime.js:62
invoke @ runtime.js:296
prototype.(anonymous function) @ runtime.js:114
step @ content.js:218
(anonymous) @ content.js:218
Promise.then (async)
step @ content.js:218
(anonymous) @ content.js:218
(anonymous) @ content.js:218
run @ content.js:171
(anonymous) @ content.js:357
EventImpl.dispatchToListener @ VM3027 extensions::event_bindings:403
publicClassPrototype.(anonymous function) @ VM3033 extensions::utils:138
EventImpl.dispatch_ @ VM3027 extensions::event_bindings:387
EventImpl.dispatch @ VM3027 extensions::event_bindings:409
publicClassPrototype.(anonymous function) @ VM3033 extensions::utils:138
messageListener @ VM3036 extensions::messaging:240
EventImpl.dispatchToListener @ VM3027 extensions::event_bindings:403
publicClassPrototype.(anonymous function) @ VM3033 extensions::utils:138
EventImpl.dispatch_ @ VM3027 extensions::event_bindings:387
EventImpl.dispatch @ VM3027 extensions::event_bindings:409
publicClassPrototype.(anonymous function) @ VM3033 extensions::utils:138
dispatchOnMessage @ VM3036 extensions::messaging:392
这是content.js第92行的专家:
case 7:
isLogged = _context3.sent;
if (!isLogged.valid) {
console.error('invalid bearer token, token=', localStorage.getItem('token'));
changeIcon('unavailable');
} else {
if (!isLogged.customerId) {
changeIcon('unavailable');
} else if (!isLogged.invitation) {
changeIcon('uninvited');
} else if (!isLogged.plan || !isLogged.plan.active) {
changeIcon('unavailable');
}
}
_context3.next = 15;
break;
该应用程序可以正常运行,但是我在控制台中充满了这些错误。
答案 0 :(得分:1)
invalid bearer token, token= null
这意味着令牌中的某个逻辑没有被保存到localStorage中。