<?php
/**
 * Created by PhpStorm.
 * User: sicilon_IT
 * Date: 2020/1/22
 * Time: 22:16
 */
namespace app\index\controller;
use app\index\logic\webmanger;
use think\Controller;

class Weblogin extends Controller{
    public function login(){
        //echo  'post ok';
        $userinfo=request() -> param();
       // var_dump($userinfo);
        $wm= new webmanger();
        $uinfo=$wm->getlogininfo($userinfo['userName'],$userinfo['password']);
        //var_dump($uinfo);
        if ($uinfo){
            $res_r['code']=200;
            $res_r['resultData']=$uinfo;
        }else{
            $res_r['code']=0;
            $res_r['errmsg']='登录失败';
        }

        return json_encode($res_r,320);
    }

    public function testlogin(){
        echo "test ok";
        $res_r['code']=0;
        $res_r['errmsg']='登录失败';
        return json_encode($res_r);
    }
}