In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article "how to check whether Mini Program's current user login status is valid" is not quite understood by most people except programmers. Today, in order to make you better understand "how to check whether Mini Program's current user login status is valid", this article summarizes the following content, which has a certain reference value, the detailed steps are clear, and the details are handled properly. I hope you can gain something through this article. Now let's take a look at the details.
The user login status obtained through the interface has a certain timeliness. The longer users do not use Mini Program, the more likely they are to invalidate their login status. On the other hand, if the user has been using Mini Program, the user's login status remains valid. The specific prescription logic is maintained by Wechat and is transparent to developers. Developers only need to call the API wx.checkSession to check whether the current user login status is valid. After the login status expires, the developer can call wx.login to obtain the new user login status.
OBJECT parameter description:
The parameter name type is required to indicate whether the successFunction API calls a successful callback function, the login state has not expired, the failed callback function has expired, and the login state has expired. The callback function ended by the API call completeFunctionNo (both successful and failed calls will be executed)
Sample code:
Wx.checkSession ({success: function () {/ / session is not expired and has been valid for the current lifecycle}, fail: function () {/ / login status expires wx.login () / / log in again. What does Mini Program mean? Mini Program is an application that can be used without download and installation. It can be used immediately by scanning a QR code or searching it. It is easy to operate and easy to spread. It can achieve seven major functions, such as message notification, offline code scanning, official account association, and so on. It is based on Wechat, similar to APP. You can use it whenever you want. After using it, you will leave without taking up memory.
Thank you for your reading. I hope you have a certain understanding of the key question of "how to test whether the current user login status of Mini Program is valid". The specific usage still needs to be understood by everyone through hands-on experiments. Go and try it. If you want to read more articles about relevant knowledge points, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.