1.
when I successfully logged in for the first time, the backend returned a token,
for me to directly use token to determine the login. If I have logged in, jump to the home page directly.
I use jquery.cookie to save the token, but I don"t know how to use this token to judge the jump.
now I want to add the following code jump directly to the landing page header, but it will feel strange. I don"t know what the correct approach is
/*token*/
var token = $.cookie("token");
if(token){
window.location.href = "index.html"
}