<?php
/**
 * Created by PhpStorm.
 * User: zilongs
 * Date: 20-9-23
 * Time: 上午11:34
 */

namespace App\Http\Controllers\Api\V1;

use App\Http\Controllers\Controller;
use App\Models\User;

class AuthController extends Controller
{
    protected $user = null;

    public function __construct()
    {
        $path = request()->getPathInfo();
        $arr = explode('/', $path);
        $path = $arr[count($arr)-2].'/'.$arr[count($arr)-1];
        $map = config('config.no_auth_function_map');
        $is_exit = true;
        if (in_array($path, $map)) {
            $is_exit = false;
        }

        $this->user = User::getUserByToken($is_exit);
    }
}
