no message

This commit is contained in:
hellcat 2026-07-26 13:50:45 +08:00
parent 6c79f85a81
commit 5fa537dfee
17 changed files with 133 additions and 12 deletions

View File

@ -9,6 +9,7 @@
use App\Models\Articles;
use App\Models\Categories;
use App\Models\ArticleFreenodeThumbNum;
use App\Models\ArticleThumbNum;
use App\Services\TomTool\HttpV2;
use App\Services\TagService;
@ -96,9 +97,69 @@ public function receive(Request $oRequest)
];
}
public function receiveShadowrocketids(Request $oRequest)
{
$sObjName = "fn-b:article_receive_shadowrocketids";
$oFlow = Flow::make($sObjName);
$aData = $oRequest->all();
$sArticle = $aData["content"] ?? '';
$sTitle = $aData["title"] ?? '';
$sTitleSub = $aData["title_sub"] ?? '';
$aArticleTags = $aData["tags"] ?? [];
$sSlug = 'ssi'.date("Ymd");
$sImgAuthor = "tg_xiuren_a";
$i7like = $aData["7like"] ?? 0;
$oThumbNum = ArticleThumbNum::firstOrCreate(["author_code" => $sImgAuthor, "type" => "shadowrocketids"]);
$iThumbNum = $oThumbNum->num;
$sImagesApi = "https://".config("path.url_resource_base")."/api/images/get/url-by-num";
$aApiArg = [
"sAuthorCode" => $sImgAuthor,
"iNum" => $iThumbNum+1,
];
$sApiResult = HttpV2::make($sImagesApi, "post")->withToken()->setDataA($aApiArg)->send();
$aApiResult = json_decode($sApiResult, true);
if (!isset($aApiResult["isDone"]) || !$aApiResult["isDone"]) {
echo $sApiResult;
return response()->json($oFlow->fail("{$sObjName}的图片api调用失败"));
}
$sThumbPath = $aApiResult["aData"]["sFileUrl"];
$sThumbNumTrue = $aApiResult["aData"]["iTrueNum"];
$oCategories = Categories::where("sSlug", "shadowrocketids")->first();
$oArticle = Articles::updateOrCreate(
['sSlug' => $sSlug],
[
'sThumb' => $sThumbPath,
'iCategoryId' => $oCategories->id,
'sTitle' => $sTitle,
'sTitleSub' => $sTitleSub,
'sContent' => $sArticle,
'i7like' => $i7like,
'iStatus' => 1,
'iUserId' => 1,
],
);
(new TagService())->syncArticleTagsByName($oArticle, $aArticleTags);
ArticleThumbNum::where("author_code", $sImgAuthor)->where("type", "shadowrocketids")->update(["num" => $sThumbNumTrue]);
$sArticleUrl = config("app.url")."/shadowrocketids/".$sSlug;
TeleSlave::notify()->send($sArticleUrl." 发布成功");
return response()->json($oFlow->done());
}
public function receiveFreenode(Request $oRequest)
{
$sObjName = "nodehub:article_receive_freenode";
$oFlow = Flow::make($sObjName);

12
app/Models/ArticleThumbNum.php Executable file
View File

@ -0,0 +1,12 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class ArticleThumbNum extends Model
{
protected $guarded = [];
public $timestamps = false;
}

View File

@ -47,8 +47,7 @@ public static function getGlobalNavTree()
return self::where('iParentId', 0)
->where('iStatus', 1)
->with(['aChildren' => fn($q) => $q->where('iStatus', 1)->orderBy('iSort', 'desc')])
->orderBy('iSort', 'desc')
->orderBy('iSort', 'asc')
->get();
}
}

View File

@ -4,5 +4,6 @@
'url_master_base' => env('url_master_base'),
'url_resource_base' => env('url_resource_base'),
'url_github_href' => env('url_github_href'),
];

BIN
public/sites/cfn/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
public/sites/cfn/siteimg.jpg Executable file

Binary file not shown.

38
resources/sites/cfn/css/app.css Executable file
View File

@ -0,0 +1,38 @@
:root {
--btn-primary:#A758A5;
--color-primary:#A758A5;
--href:#0d6efd;
}
.site-main {
min-height:1000px;
}
.menua-checked {
color: var(--color-primary);
}
.menua:hover {
color:var(--color-primary) !important;
}
.menuaSub:hover {
color:var(--color-primary) !important;
}
.widget-border {
background-image: linear-gradient(to right,#7E427C,#995097,#A359A1,#7E427C) !important;
/* background-image: linear-gradient(to right,#7E427C,#995097,#A359A1,#7E427C) !important; */
}
/*.list-home {*/
/* height:500px;*/
/*}*/
.header .navbar-brand img {
max-height: 50px;
}
.header .navbar-brand {
max-width: 250px;
}

View File

@ -52,14 +52,22 @@ class="d-none logo-dark nc-no-lazy"
</ul>
<ul class="navbar-nav align-items-center">
<li class="nav-item me-2 me-md-3">
<button class="btn btn-link btn-icon btn-sm btn-rounded nav-search collapsed"
data-bs-toggle="collapse" data-bs-target="#navbar-search" aria-expanded="false"
aria-controls="navbar-search">
<span>
<i class="iconfont icon-search"></i>
<i class="iconfont icon-close"></i>
</span>
</button>
<a href="{{ config('path.url_github_href') }}" target="_blank" rel="noopener noreferrer">
<button class="btn btn-link btn-icon btn-sm btn-rounded nav-search collapsed">
<span>
<i class="iconfont icon-github-fill"></i>
</span>
</button>
</a>
<button class="btn btn-link btn-icon btn-sm btn-rounded nav-search collapsed"
data-bs-toggle="collapse" data-bs-target="#navbar-search" aria-expanded="false"
aria-controls="navbar-search">
<span>
<i class="iconfont icon-search"></i>
<i class="iconfont icon-close"></i>
</span>
</button>
</li>
</ul>
</div>

View File

@ -54,7 +54,7 @@
</div>
</div>
<div class="post-content">
@if ($oArticle->sThumb)
@if ($oArticle->bPageThumb && $oArticle->sThumb)
<p>
<img decoding="async" class="size-full wp-image-28 aligncenter" src="{{ $oArticle->sThumb }}" style="border-radius: 6px;">
</p>

View File

@ -10,6 +10,7 @@
use App\Http\Controllers\Api\v1\ArticlesController as ApiV1ArticlesController;
use App\Http\Controllers\Api\v1\FreenodeController as ApiV1FreenodeController;
Route::post('/api/article/receive/shadowrocketids', [ApiV1ArticlesController::class, 'receiveShadowrocketids']);
Route::post('/api/article/receive/freenode', [ApiV1ArticlesController::class, 'receiveFreenode']);
Route::post('/api/article/receive', [ApiV1ArticlesController::class, 'receive']);
//Route::post('/api/freenode/receive', [ApiV1FreenodeController::class, 'receive']);

View File

@ -9,6 +9,7 @@ export default defineConfig({
'resources/css/app.css',
'resources/js/app.js',
'resources/sites/vfn/css/app.css',
'resources/sites/cfn/css/app.css',
],
refresh: true,
}),