import AccessToken from '@/common/cache/AccessToken';
import SysAuthController from '../apis/SysAuthController';

/** 账户密码登录 */
export async function loginByAccount(data: API.LoginInput) {
    const res = await SysAuthController.loginByAccount(data);
    if (!res) {
        return false;
    }
    if (res.accessToken) {
        AccessToken.set(res.accessToken);
    }
    return res;
}
