<?php

namespace App\Domains\Virtual\Handler;

use App\Exceptions\AuthException;

class AuthCompanyCheckAccount
{
    public function handle($account, $request)
    {
        // 已禁用
        if ($account->status === 2) {
            app('auth:company')->logout();
            throw new AuthException('账号被禁用', AuthException::ACCOUNT_DISABLED);
        }

        // 手机号未绑定
        if (empty($account->mobile)) {
            // throw new AuthException('手机号未绑定', AuthException::NOT_BOUND_MOBILE);
        }
    }
}
