no message
This commit is contained in:
parent
6c79f85a81
commit
5fa537dfee
@ -9,6 +9,7 @@
|
|||||||
use App\Models\Articles;
|
use App\Models\Articles;
|
||||||
use App\Models\Categories;
|
use App\Models\Categories;
|
||||||
use App\Models\ArticleFreenodeThumbNum;
|
use App\Models\ArticleFreenodeThumbNum;
|
||||||
|
use App\Models\ArticleThumbNum;
|
||||||
use App\Services\TomTool\HttpV2;
|
use App\Services\TomTool\HttpV2;
|
||||||
use App\Services\TagService;
|
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)
|
public function receiveFreenode(Request $oRequest)
|
||||||
{
|
{
|
||||||
|
|
||||||
$sObjName = "nodehub:article_receive_freenode";
|
$sObjName = "nodehub:article_receive_freenode";
|
||||||
$oFlow = Flow::make($sObjName);
|
$oFlow = Flow::make($sObjName);
|
||||||
|
|
||||||
|
|||||||
12
app/Models/ArticleThumbNum.php
Executable file
12
app/Models/ArticleThumbNum.php
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class ArticleThumbNum extends Model
|
||||||
|
{
|
||||||
|
protected $guarded = [];
|
||||||
|
public $timestamps = false;
|
||||||
|
|
||||||
|
}
|
||||||
@ -47,8 +47,7 @@ public static function getGlobalNavTree()
|
|||||||
return self::where('iParentId', 0)
|
return self::where('iParentId', 0)
|
||||||
->where('iStatus', 1)
|
->where('iStatus', 1)
|
||||||
->with(['aChildren' => fn($q) => $q->where('iStatus', 1)->orderBy('iSort', 'desc')])
|
->with(['aChildren' => fn($q) => $q->where('iStatus', 1)->orderBy('iSort', 'desc')])
|
||||||
->orderBy('iSort', 'desc')
|
->orderBy('iSort', 'asc')
|
||||||
->get();
|
->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,5 +4,6 @@
|
|||||||
|
|
||||||
'url_master_base' => env('url_master_base'),
|
'url_master_base' => env('url_master_base'),
|
||||||
'url_resource_base' => env('url_resource_base'),
|
'url_resource_base' => env('url_resource_base'),
|
||||||
|
'url_github_href' => env('url_github_href'),
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|||||||
BIN
public/sites/cfn/icon.png
Normal file
BIN
public/sites/cfn/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.3 KiB |
BIN
public/sites/cfn/images/banner/andorid.jpg
Executable file
BIN
public/sites/cfn/images/banner/andorid.jpg
Executable file
Binary file not shown.
BIN
public/sites/cfn/images/banner/ios.jpg
Executable file
BIN
public/sites/cfn/images/banner/ios.jpg
Executable file
Binary file not shown.
BIN
public/sites/cfn/images/banner/linux.jpg
Executable file
BIN
public/sites/cfn/images/banner/linux.jpg
Executable file
Binary file not shown.
BIN
public/sites/cfn/images/banner/macos.jpg
Executable file
BIN
public/sites/cfn/images/banner/macos.jpg
Executable file
Binary file not shown.
BIN
public/sites/cfn/images/banner/windows.jpg
Executable file
BIN
public/sites/cfn/images/banner/windows.jpg
Executable file
Binary file not shown.
BIN
public/sites/cfn/images/logo/logo.png
Executable file
BIN
public/sites/cfn/images/logo/logo.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
BIN
public/sites/cfn/siteimg.jpg
Executable file
BIN
public/sites/cfn/siteimg.jpg
Executable file
Binary file not shown.
38
resources/sites/cfn/css/app.css
Executable file
38
resources/sites/cfn/css/app.css
Executable 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;
|
||||||
|
}
|
||||||
@ -52,14 +52,22 @@ class="d-none logo-dark nc-no-lazy"
|
|||||||
</ul>
|
</ul>
|
||||||
<ul class="navbar-nav align-items-center">
|
<ul class="navbar-nav align-items-center">
|
||||||
<li class="nav-item me-2 me-md-3">
|
<li class="nav-item me-2 me-md-3">
|
||||||
<button class="btn btn-link btn-icon btn-sm btn-rounded nav-search collapsed"
|
<a href="{{ config('path.url_github_href') }}" target="_blank" rel="noopener noreferrer">
|
||||||
data-bs-toggle="collapse" data-bs-target="#navbar-search" aria-expanded="false"
|
<button class="btn btn-link btn-icon btn-sm btn-rounded nav-search collapsed">
|
||||||
aria-controls="navbar-search">
|
<span>
|
||||||
<span>
|
<i class="iconfont icon-github-fill"></i>
|
||||||
<i class="iconfont icon-search"></i>
|
</span>
|
||||||
<i class="iconfont icon-close"></i>
|
</button>
|
||||||
</span>
|
</a>
|
||||||
</button>
|
|
||||||
|
<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>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -54,7 +54,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
@if ($oArticle->sThumb)
|
@if ($oArticle->bPageThumb && $oArticle->sThumb)
|
||||||
<p>
|
<p>
|
||||||
<img decoding="async" class="size-full wp-image-28 aligncenter" src="{{ $oArticle->sThumb }}" style="border-radius: 6px;">
|
<img decoding="async" class="size-full wp-image-28 aligncenter" src="{{ $oArticle->sThumb }}" style="border-radius: 6px;">
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@ -10,6 +10,7 @@
|
|||||||
use App\Http\Controllers\Api\v1\ArticlesController as ApiV1ArticlesController;
|
use App\Http\Controllers\Api\v1\ArticlesController as ApiV1ArticlesController;
|
||||||
use App\Http\Controllers\Api\v1\FreenodeController as ApiV1FreenodeController;
|
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/freenode', [ApiV1ArticlesController::class, 'receiveFreenode']);
|
||||||
Route::post('/api/article/receive', [ApiV1ArticlesController::class, 'receive']);
|
Route::post('/api/article/receive', [ApiV1ArticlesController::class, 'receive']);
|
||||||
//Route::post('/api/freenode/receive', [ApiV1FreenodeController::class, 'receive']);
|
//Route::post('/api/freenode/receive', [ApiV1FreenodeController::class, 'receive']);
|
||||||
|
|||||||
@ -9,6 +9,7 @@ export default defineConfig({
|
|||||||
'resources/css/app.css',
|
'resources/css/app.css',
|
||||||
'resources/js/app.js',
|
'resources/js/app.js',
|
||||||
'resources/sites/vfn/css/app.css',
|
'resources/sites/vfn/css/app.css',
|
||||||
|
'resources/sites/cfn/css/app.css',
|
||||||
],
|
],
|
||||||
refresh: true,
|
refresh: true,
|
||||||
}),
|
}),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user