$info['admin_id'] ); $token = JwtToken::generateToken($extend); }else{ throw new \Exception('账号不存在'); } $update = array( 'admin_last_ip' => get_ip(), 'admin_last_time' => date("Y-m-d H:i:s", time()), 'admin_login_count' => bcadd((string)$info['admin_login_count'],'1'), 'admin_update_time' => date('Y-m-d H:i:s', time()) ); SystemAdmin::updateInfo($info['admin_id'], $update); SystemAdmin::affairCommit(); unset($info['admin_pwd']); $token['userInfo'] = $info; return $token; }catch (\Exception $exception){ SystemAdmin::affairRollback(); throw new \Exception($exception->getMessage()); } } /** * Notes:退出登录 * @param string $token * @return bool * User: yym * Date: 2022/8/3 */ public static function loginOut(string $token) { if(empty($token)) { return true; } JwtToken::delKey(1, $token); return true; } }