Persistent token. This is how I implemented it: when logging in, the token will come back, and I saved it locally. Each time the interface is called, the token is returned. If the token expires, the server will return a status message, and I will jump back to the login interface and request the token again. above! Hope it helps you
This is what I did. By default, I go directly to get the content and judge the result. If not logged in, call the login method (the token will be returned after success) and then grab the web page, because some tokens themselves are also time-sensitive, local transformation may not be reliable.
1. In your http request header, put the token in and check the knowledge about http. 2. The token will expire, as mentioned above, so how to deal with it once it expires needs to be related to the server. Good deal
Persistent token. This is how I implemented it: when logging in, the token will come back, and I saved it locally. Each time the interface is called, the token is returned. If the token expires, the server will return a status message, and I will jump back to the login interface and request the token again. above! Hope it helps you
This is what I did. By default, I go directly to get the content and judge the result. If not logged in, call the login method (the token will be returned after success) and then grab the web page, because some tokens themselves are also time-sensitive, local transformation may not be reliable.
1. In your http request header, put the token in and check the knowledge about http.
2. The token will expire, as mentioned above, so how to deal with it once it expires needs to be related to the server. Good deal
First negotiate with the service where to put the token 'url, head, body? Decide on the location and insert interpra' in okhttp to make global changes