优化API接口代码,增强数据库连接安全性与代码可读性

This commit is contained in:
2024-12-22 15:48:03 +08:00
parent f21a71eb6f
commit 5b0873b4d4
2 changed files with 32 additions and 21 deletions

View File

@@ -83,13 +83,11 @@ if (isset($getTokenArr['access_token'])) {
$checkLink = get_curl("/api?act=check&connect_id=" . $getUserArr['username']);
$getCheckLink = json_decode($checkLink, true);
} else {
$err = json_encode($getTokenArr);
}
?>
<!DOCTYPE HTML>
<html>
@@ -157,7 +155,7 @@ if (isset($getTokenArr['access_token'])) {
<input type="hidden" id="linuxdo" value="<?= $getUserArr['username'] ?>">
<?php if (!empty($err)) { ?>
授权发生异常:<?= $err ?>
<?php } elseif (empty($row)) { ?>
<?php } elseif ($getCheckLink['code'] == '1') { ?>
<div
style="width:400px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;justify-content:center;align-items:center;flex-direction:column;">
当前尚未有你的游戏账号,请选择<br>
@@ -174,4 +172,4 @@ if (isset($getTokenArr['access_token'])) {
<?php } ?>
</body>
</html>
</html>