how can vue.js keep its login status when writing spa applications?
how can vue.js keep its login status when writing spa applications?
generally, after the background verifies that the user name and password are correct, a code, server that generates the user login status is saved with session, and the front end is saved with cookie. This is operated by the server, not the front end. Because each http request will also automatically take the cookie, server to compare the value of cookie in the request with the value in session to confirm the login status of the user. This is the principle of the login state. It has nothing to do with vue.js writing spa applications. It's all the same way.
generally, the backend will return a token value in the foreground. You can store this value in cookice or sessionstorage, or you can use vuex to obtain it (it is not recommended to save it directly in vuex. In this way, a refreshed page will lose), and every time you need to request data from the backend, bring this token to the backend to check whether the token is correct and expired. Then send you the corresponding data
topic description when I modify the .vue file, the browser does refresh, but the content is not updated. At this time, I go to change any js file, and the contents of the previous changes to the .vue file will be updated and displayed to the browser. ...
examples of just getting started using laravel with vue components: follow the tutorial to write the following examples mainly uses three files welcomeComponent.vue, app.js and index.blade.php directory structure as follows welcomeComponent.vue ap...
use laravel mix to do vue contact projects. Encountered a problem while using vue-router < H2 > Project structure < H2 > router.js foo.vue app.js home.html component what is my problem? thank you for correcting all the source codes have be...