Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在开发一个带有令牌身份验证和刷新令牌的 AnjularJS 项目。
在某些情况下,当我提交表单并进行 api 调用时,我会得到 401,其中令牌已过期并自动刷新令牌。哪个工作得很好。
我遇到的问题是,在刷新令牌后,我想自动进行 api 调用以重新提交表单。
我是否必须创建服务来跟踪所有呼叫?角度是否会跟踪所有呼叫?
关于如何做到这一点的任何想法。
谢谢
我使用以下模块创建所有状态的缓冲区,然后我只需要重新创建缓冲区中的所有 api 调用。
我使用了 https://github.com/witoldsz/angular-http-auth