登录处理

This commit is contained in:
2025-08-12 11:16:48 +08:00
parent 06c5df0207
commit f9d9a1bf5c
2 changed files with 5 additions and 6 deletions

View File

@@ -10,14 +10,14 @@ class UserToken extends Model
public function check_login_token($token)
{
if (empty($token)) {
return ['code' => 301, 'msg' => '登录失效', 'data' =>null];
return ['code' => 301, 'msg' => '登录失效!', 'data' =>null];
}
$user_token = $this->where('token', $token)->find();
if (empty($user_token)) {
return ['code' => 301, 'msg' => '登录失效', 'data' => null];
return ['code' => 301, 'msg' => '登录失效!!', 'data' => null];
}
if ($user_token['expiretime'] < time()) {
return ['code' => 301, 'msg'=> '登录失效', 'data' => null];
return ['code' => 301, 'msg'=> '登录失效!!!', 'data' => null];
}
$block1 = db::name('block')->where(['type' => 1,'type_text' => $user_token['user_id']])->find();