Login Plugin app based on Thinkphp5.0 applet

Source: Internet
Author: User

Resource connection:

Wulongtao/think-wxminihelper

Specific how to install, do not introduce, have not understand ask me again, the main focus is as follows:

Wepy:index.wpy

  1. This method $parent. GetUserInfo (userinfo) {}) Wepy only obtains the basic data; need to use: Wepy.getuserinfo ()
  2. $session 3rd = $this->randomfromdev (16) Plug-in application of this method, the need for Linux environment otherwise will be error;


    workaround (so PHP is going to generate true random numbers or call external elements to support it!) ): $fp = @fopen ('/dev/urandom ', ' RB ') it is best to use this method in order to generate true random numbers.
    If you develop locally, you can use false random numbers. Temporary use. Then replace it back. The code is as follows:
    /* * * Generate random number, can user verification code * @param */ function randstr ($m = 5) {    = ';     = ' ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwsyz0123456789 ';    $max=strlen ($str)-1;      for ($i = 1; $i <= $m; + +$i) {        $new _str. = $str [Mt_rand (0, $max)];    }     return $new _str;}

Login Plugin app based on Thinkphp5.0 applet

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.