Found lazy way to create api

This commit is contained in:
Ibnu Maksum
2024-03-31 21:23:19 +07:00
parent 4bf6f9c0ac
commit ee73621c85
5 changed files with 50 additions and 31 deletions

View File

@ -30,6 +30,13 @@ switch ($do) {
$d->last_login = date('Y-m-d H:i:s');
$d->save();
_log($username . ' ' . Lang::T('Login Successful'), $d['user_type'], $d['id']);
if ($isApi) {
if ($token) {
showResult(true, Lang::T('Login Successful'), ['token' => "a.".$token]);
} else {
showResult(false, Lang::T('Invalid Username or Password'));
}
}
_alert(Lang::T('Login Successful'),'success', "dashboard");
} else {
_log($username . ' ' . Lang::T('Failed Login'), $d['user_type']);