How to use the token front end in the RESTful interface?



the backend gives a RESTful interface document, and the request header needs a token to return success. Did I write this token when I was requested by the front-end ajax? What"s the point if
is not generated dynamically?
this is how my Mini Program uses it.

         wx.request({
            url: url,
            data: data,
            method: method,
            header: {
              "Authorization": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI0YTJiZWRlMDZkOTE0OTIxOGFhMDQ0NzU2MTg4MTE0YTQ2NzMyMTE0Iiwic2NvcGUiOiJhY2Nlc3NfdG9rZW4iLCJpYXQiOjE1MjIxMjA1MDYsImV4cCI6MTUyNDI2Nzk5MH0.gbtccP_J_BH24BXX5XEq-Oq73-_MDjTroD6wAqZf7dM"
            },
            ...

this temporary token must be obtained when logging in or obtaining user information


must not be written dead, the token should be given to you at the backend, and the backend should have an API to guide you to obtain the token, you want to save this token. And bring this token to every request.

Menu