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
This method $parent. GetUserInfo (userinfo) {}) Wepy only obtains the basic data; need to use: Wepy.getuserinfo ()
$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