Request header Authorization

The Authorization header is mainly used for authentication of the http protocol.
The role of Authorization is that when the client access is protected by a password, the server will send a 401 status code and a WWW-Authenticate response header, requiring the client to respond using Authorization.

      config.headers['Authorization'] = 'Bearer ' + getToken()

Note: A space needs to be added after Bearer

おすすめ

転載: blog.csdn.net/SYQ15544423296/article/details/132854056