diff --git a/admin/index.php b/admin/index.php
index c2d1b28..c4e1ec1 100644
--- a/admin/index.php
+++ b/admin/index.php
@@ -80,6 +80,9 @@ if (!$resultApps) {
管理开发者
+
+ 系统信息
+
退出登录
diff --git a/admin/system_info.php b/admin/system_info.php
new file mode 100644
index 0000000..ff7e427
--- /dev/null
+++ b/admin/system_info.php
@@ -0,0 +1,194 @@
+ $file,
+ 'size' => $file_size,
+ 'type' => strpos($dir, 'images') !== false ? '图片' : '文件'
+ ];
+ }
+ }
+ }
+ }
+ }
+
+ return $uploaded_files;
+}
+
+$uploaded_files = get_uploaded_files_info();
+?>
+
+
+
+
+
+ 系统信息 - 上传文件列表
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app.php b/app.php
index dd8e658..b6b9a91 100644
--- a/app.php
+++ b/app.php
@@ -65,7 +65,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['rating'])) {
-
+
@@ -116,11 +116,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['rating'])) {
适用平台: '',
- 'Mac' => '',
- 'Linux' => '',
- 'Android' => '',
- 'iOS' => ''
+ 'windows' => '',
+ 'macos' => '',
+ 'linux' => '',
+ 'android' => '',
+ 'ios' => ''
];
$platformMap = [
'android' => 'Android',
@@ -134,7 +134,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['rating'])) {
$platformTexts = [];
foreach ($platforms as $platform) {
- $icon = $platformIcons[ucfirst($platform)] ?? '';
+ $icon = $platformIcons[strtolower($platform)] ?? '';
$readableName = $platformMap[strtolower($platform)] ?? ucfirst($platform);
$platformTexts[] = $icon . ' ' . $readableName;
}
diff --git a/app_store.sql b/app_store.sql
index 79da58b..29a570a 100644
--- a/app_store.sql
+++ b/app_store.sql
@@ -198,6 +198,10 @@ EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @exist_fk = (SELECT COUNT(*) FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'apps' AND COLUMN_NAME = 'developer_id' AND CONSTRAINT_NAME = 'fk_apps_developers');
+
+-- 添加 social_links 字段到 developers 表
+ALTER TABLE developers
+ADD COLUMN social_links VARCHAR(255) DEFAULT '' AFTER password;
SET @sql = IF(@exist_fk = 0, 'ALTER TABLE apps ADD CONSTRAINT fk_apps_developers FOREIGN KEY (developer_id) REFERENCES developers(id) ON DELETE SET NULL', 'SELECT 1');
PREPARE stmt FROM @sql;
EXECUTE stmt;
diff --git a/app_store_update.sql b/app_store_update.sql
new file mode 100644
index 0000000..78502ca
--- /dev/null
+++ b/app_store_update.sql
@@ -0,0 +1,3 @@
+-- 添加 social_links 字段到 developers 表
+ALTER TABLE developers
+ADD COLUMN social_links VARCHAR(255) DEFAULT '' AFTER password;
\ No newline at end of file
diff --git a/developer/dashboard.php b/developer/dashboard.php
index fe089c1..ceca2a4 100644
--- a/developer/dashboard.php
+++ b/developer/dashboard.php
@@ -145,11 +145,14 @@ if (!($conn instanceof mysqli)) {
应用仪表盘
- 上传应用
-
-
- 退出登录
-
+ 上传应用
+
+
+ 更改信息
+
+
+ 退出登录
+
diff --git a/developer/profile.php b/developer/profile.php
new file mode 100644
index 0000000..c1b301b
--- /dev/null
+++ b/developer/profile.php
@@ -0,0 +1,189 @@
+prepare('SELECT username, email, social_links FROM developers WHERE id = ?');
+ if (!$stmt) {
+ log_error('获取开发者信息查询准备失败: ' . $conn->error, __FILE__, __LINE__);
+ $error = '获取开发者信息时发生错误,请稍后再试';
+ } else {
+ $stmt->bind_param('i', $developerId);
+ if (!$stmt->execute()) {
+ log_error('获取开发者信息查询执行失败: ' . $stmt->error, __FILE__, __LINE__);
+ $error = '获取开发者信息时发生错误,请稍后再试';
+ } else {
+ $result = $stmt->get_result();
+ $developer = $result->fetch_assoc();
+ }
+ }
+
+ // 处理表单提交
+ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
+ $newUsername = trim($_POST['username']);
+ $newEmail = trim($_POST['email']);
+ $newPassword = $_POST['password'];
+ $newSocialLinks = trim($_POST['social_links']);
+
+ // 更新用户名和邮箱
+ $stmt = $conn->prepare('UPDATE developers SET username = ?, email = ?, social_links = ? WHERE id = ?');
+ if (!$stmt) {
+ log_error('更新开发者信息查询准备失败: ' . $conn->error, __FILE__, __LINE__);
+ $error = '更新信息时发生错误,请稍后再试';
+ } else {
+ $stmt->bind_param('sssi', $newUsername, $newEmail, $newSocialLinks, $developerId);
+ if (!$stmt->execute()) {
+ log_error('更新开发者信息查询执行失败: ' . $stmt->error, __FILE__, __LINE__);
+ $error = '更新信息时发生错误,请稍后再试';
+ } else {
+ // 更新密码
+ if (!empty($newPassword)) {
+ $hashedPassword = password_hash($newPassword, PASSWORD_DEFAULT);
+ $stmt = $conn->prepare('UPDATE developers SET password = ? WHERE id = ?');
+ if (!$stmt) {
+ log_error('更新密码查询准备失败: ' . $conn->error, __FILE__, __LINE__);
+ $error = '更新密码时发生错误,请稍后再试';
+ } else {
+ $stmt->bind_param('si', $hashedPassword, $developerId);
+ if (!$stmt->execute()) {
+ log_error('更新密码查询执行失败: ' . $stmt->error, __FILE__, __LINE__);
+ $error = '更新密码时发生错误,请稍后再试';
+ }
+ }
+ }
+ if (empty($error)) {
+ $success = '信息更新成功';
+ $_SESSION['developer_username'] = $newUsername;
+ // 重新获取开发者信息
+ $stmt = $conn->prepare('SELECT username, email, social_links FROM developers WHERE id = ?');
+ if ($stmt) {
+ $stmt->bind_param('i', $developerId);
+ if ($stmt->execute()) {
+ $result = $stmt->get_result();
+ $developer = $result->fetch_assoc();
+ }
+ }
+ }
+ }
+ }
+ }
+}
+?>
+
+
+
+
+
+
+ 开发者信息 -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/developer_apps.php b/developer_apps.php
index a500e0c..ce857a7 100644
--- a/developer_apps.php
+++ b/developer_apps.php
@@ -11,7 +11,7 @@ if (!isset($_GET['id']) || !is_numeric($_GET['id'])) {
$developerId = intval($_GET['id']);
// 获取开发者信息
-$sqlDeveloper = "SELECT username FROM developers WHERE id = $developerId";
+$sqlDeveloper = "SELECT username, social_links FROM developers WHERE id = $developerId";
$resultDeveloper = $conn->query($sqlDeveloper);
$developer = $resultDeveloper->fetch_assoc();
@@ -40,7 +40,7 @@ $resultApps = $conn->query($sqlApps);
-
+
@@ -96,6 +96,27 @@ $resultApps = $conn->query($sqlApps);
的应用
+
+
+
num_rows > 0): ?>