no message

This commit is contained in:
hellcat committed 2025-12-19 17:38:00 +08:00
1 parent 9ad13bfdde
commit 5b079de70b
16 files changed
+1193 -368

No files matched your search

@@ -94,9 +94,44 @@ class FreenodeController extends Controller
TeleSlave::log()->enableSlaveQueue(false)->send("新fn文章:".$sHtmlUrl);
self::_delLast();
return $sHtmlUrl;
}
private function _delLast()
{
$iLastTime = strtotime("+365 day"); // 这边保存1年
// $sLastDate = date("Y-m-d", $iLastTime);
$sLastDateCode = date("Ymd", $iLastTime);
// 删除file
foreach (self::$sEnding as $sClient => $sEnding) {
$sFilePath = "sub/".$sLastDateCode."-".$sClient.$sEnding;
if (file_exists($sFilePath)) {
if (unlink($sFilePath)) {
// echo " - 文件删除成功".$sFilePath."\n";
} else {
$sMsg = " - 文件删除失败 -> ".$sFilePath."\n";
TeleSlave::warn()->send($sMsg);
}
}
}
// 删除html
$sHtmlPath = "fn/".$sLastDateCode.".html";
if (file_exists($sHtmlPath)) {
if (unlink($sHtmlPath)) {
// echo " - 文件删除成功".$sHtmlPath."\n";
} else {
$sMsg = " - 文件删除失败 -> ".$sHtmlPath."\n";
TeleSlave::warn()->send($sMsg);
}
}
}
private function _saveHtml($sDateCode)
{
$sFreenodeNewUrl = env("APP_URL")."/fn/single/".$sDateCode;
@@ -71,8 +71,8 @@ final class HookController
$sClassPath = "App\\Services\\TG\\Hook\\Mod\\".$sClass;
if (method_exists($sClassPath, $sFunc)) {
$oInstans = new $sClassPath();
// if (method_exists($sClassPath, $sFunc)) {
$oInstans = new $sClassPath($aUpdate);
$r = $oInstans->$sFunc($aParams);
// 可以不返回,里面直接send
@@ -90,9 +90,9 @@ final class HookController
Http::response(200);
}
} else {
throw new \Exception("没有这个方法:".$sClass.'#'.$sFunc);
}
// } else {
// throw new \Exception("没有这个方法:".$sClass.'#'.$sFunc);
// }
} catch (\Throwable $e) {
$sMessage = "错误(line:".$e->getLine()."): " . $e->getMessage();