Current location - Quotes Website - Signature design - Socket front-end and back-end communication is successful, how to get token nodejs?
Socket front-end and back-end communication is successful, how to get token nodejs?
const get =()= & gt; New commitment ((settlement, rejection) =>{

//Get the logic of the token

//If successful, call resolve.

//Call reject if it fails.

});

//Judge whether the token is successfully acquired, and if it fails, re-acquire it, but it will fall into a loop here?

const getToken = get()。 Then (

Token => token

). catch (

Err => getoken ()

)

getToken()。 Then (token =>{

//How to get a token ...

});