application/index/controller/LoginOther.php
(开头部分) 8KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
namespace app\index\controller;
//use think\Controller;
use app\index\model\UserSpace;
//use alidayu\SendSms;
// use alidayu\Autoloader;
class LoginOther extends Base
{
public function index()
{
$qq_open_id=session('qq_open_id', '', 'index');
$is_user=$this->check_qq_open_id($qq_open_id);
if($is_user){
$this->redirect('Index/index');
}
$name_arr= $this-> name_arr;
$rand_num=rand(0,99);
$new_password=rand(10000,99999);
$sub_qq_open_id=substr($qq_open_id,4,6);
// $new_password=substr($qq_open_id,12,5);
$this->assign('rand_name', $name_arr[$rand_num].strtolower($sub_qq_open_id));
$this->assign('rand_password', $new_password);
return $this->fetch();
}
//检查qq_open_id是否存在
public function check_qq_open_id($qq_open_id)
{
$UserSpace= UserSpace::where(['qq_open_id' => $qq_open_id])->find();
if($UserSpace){
session('uid', $UserSpace['uid'], 'index');
session('username', $UserSpace['username'], 'index');
return 1;
}else{return 0;}
}
public function check_username()
{
$username= request()->param('value');
$UserSpace= UserSpace::where(['username' => $username])->find();
if($UserSpace){ $res=1;}else{ $res=0;}
// $res=1;
if($res){
$data = ['info' => "用户存在", 'status' => 1];
}else{
$data = ['info' => "用户不存在", 'status' => 0];
}
return json($data);
}
//根据qq_open_id和随机用户名添加新用户
public function add_user_by_username()
{
$username= request()->param('value');
$new_password= request()->param('id');
$qq_open_id=session('qq_open_id', '', 'index');
$user = new UserSpace;
$user->username = $username;
$user->password = md5(sha1($new_password));
后面还有 145 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。