init 全新仓库,清除全部历史

This commit is contained in:
2026-07-09 09:54:43 +08:00
commit 0c2fe393df
154 changed files with 56586 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
<?php
session_start();
$expire = 1800;
if (empty($_SESSION['user_id']) || (time() - $_SESSION['login_time'] > $expire)) {
echo json_encode(["code"=>401,"msg"=>"未登录"]);
exit;
}
header("Content-Type:application/json;charset=utf-8");
$configFile = "./system_config.json";
if(!file_exists($configFile)){
echo json_encode(["code"=>500,"msg"=>"配置文件缺失"]);
exit;
}
$config = json_decode(file_get_contents($configFile),true);
$act = $_POST['act'] ?? '';
if($act == "save_style"){
$config['theme_color'] = $_POST['theme_color'];
$config['card_bg'] = $_POST['card_bg'];
$config['body_bg'] = $_POST['body_bg'];
$config['font_family'] = $_POST['font_family'];
file_put_contents($configFile,json_encode($config,JSON_UNESCAPED_UNICODE));
echo json_encode(["code"=>0,"msg"=>"样式保存成功,刷新页面生效"]);
exit;
}
if($act == "save_sidebar_link"){
$list = json_decode($_POST['link_list'],true);
$config['sidebar_links'] = $list;
file_put_contents($configFile,json_encode($config,JSON_UNESCAPED_UNICODE));
echo json_encode(["code"=>0,"msg"=>"侧边栏链接更新成功"]);
exit;
}
if($act == "get_config"){
echo json_encode(["code"=>0,"data"=>$config]);
exit;
}
echo json_encode(["code"=>400,"msg"=>"非法操作"]);
?>