Add Multilingualism. Closed #145

This commit is contained in:
WispX
2021-07-26 17:58:17 +08:00
parent c09bece154
commit d09d57dbe1
43 changed files with 535 additions and 372 deletions
+3 -3
View File
@@ -17,16 +17,16 @@ class Token extends Base
$user = null;
try {
if (!$user = Users::get(['email' => $email])) {
throw new Exception('账号不存在');
throw new Exception(lang('Account does not exist'));
}
if ($user->password != md5($password)) {
throw new Exception('账号密码错误');
throw new Exception(lang('Account password error'));
}
if ('true' == $refresh) {
$token = make_token();
$user->token = $token;
if (!$user->save()) {
throw new Exception('Token 刷新失败');
throw new Exception(lang('Token refresh failed'));
}
}
} catch (Exception $e) {