<?php

namespace App\Http\Controllers\Api\User;

use App\Http\Controllers\Controller;
use App\Service\UserService;
use Illuminate\Http\Request;

class AuthController extends Controller
{
    public function login(Request $request)
    {
        $data = $request->input();
        $res = app(UserService::class)->login($data);
        return $this->success('success', $res);
    }

    /**
     * 退出登录
     *
     * @return mixed
     */
    public function logout()
    {
        $result = app(UserService::class)->logout();
        return $this->success('success', $result);
    }
}
