|
|
@@ -5,9 +5,40 @@ namespace App\Http\Controllers\Sys;
|
|
|
use Illuminate\Http\Request;
|
|
|
use App\Http\Controllers\Controller;
|
|
|
use PHPMailer\PHPMailer\Exception;
|
|
|
+use Illuminate\Support\Facades\DB;
|
|
|
+
|
|
|
|
|
|
class UserController extends Controller
|
|
|
{
|
|
|
+
|
|
|
+ //匿名注册
|
|
|
+ public function hideRegister(){
|
|
|
+ $ip = GETIP();
|
|
|
+
|
|
|
+ //生成随机用户
|
|
|
+ $seed = time();
|
|
|
+ $name = rand(0,$seed);
|
|
|
+ $pwd = '123456';
|
|
|
+ $uuid = getUUID();
|
|
|
+ $userData = [
|
|
|
+ 'name' =>'youke_'.$name,
|
|
|
+// 'phone' =>18000000002,
|
|
|
+ 'uuid' =>$uuid,
|
|
|
+ 'password' =>createPasswd(trim($pwd),$uuid),
|
|
|
+ 'status' => 2,
|
|
|
+ 'user_ip' =>$ip,
|
|
|
+ 'created_at' =>date('Y-m-d H:i:s'),
|
|
|
+ 'updated_at' =>date('Y-m-d H:i:s'),
|
|
|
+ ];
|
|
|
+
|
|
|
+ try{
|
|
|
+ $ret = DB::table('members')->insert($userData);
|
|
|
+ }catch(Exception $ex){
|
|
|
+ return toJson(-20001);
|
|
|
+ }
|
|
|
+
|
|
|
+ return toJson(1);
|
|
|
+ }
|
|
|
public function register(Request $req)
|
|
|
{
|
|
|
$user=[];
|