Home>Article>Web Front-end> How does uniapp check whether the user is logged in?
Uniapp's method of checking whether the user is logged in: first open the [user.vue] file in the APP code; then use uni's setstorage API to obtain the value. If the value is obtained, it means that the user is logged in. If you do not get the value, You will not be able to jump to the login interface.
The operating environment of this tutorial: windows7 system, uni-app2.5.1 version. This method is suitable for all brands of computers.
Recommended (free):uni-app development tutorial
Uniapp method to check whether the user is logged in:
Open us The user.vue file in the APP code:
##Implementing logic When we determine whether the user is logged in, we need to store a value into the client. If this value exists, it means the user is logged in, if not, the user needs to log in. So the first logic we need to do is: use uni's setstorage API to get the value. If you get the value, it means you are logged in. If you don't get the value, you will not be able to jump to the login interface. Logical CodingAfter saving the code and running it in the browser, you will find that as long as you click on the user interface, you will jump to the login page, because at this time It's worthless.language-javascript
Related free learning recommendations:php programming(video)
The above is the detailed content of How does uniapp check whether the user is logged in?. For more information, please follow other related articles on the PHP Chinese website!