作者 lyh

gx

  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :CNoticeController.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2023/9/12 10:04
  8 + */
  9 +
  10 +namespace App\Http\Controllers\Aside\Com;
  11 +
  12 +
  13 +use App\Http\Controllers\Aside\BaseController;
  14 +use App\Models\Domain\DomainInfo;
  15 +use App\Models\Project\DeployBuild;
  16 +use Illuminate\Http\Request;
  17 +
  18 +
  19 +/**
  20 + * @remark :通知C端
  21 + * @name :CNoticeController
  22 + * @author :lyh
  23 + * @method :post
  24 + * @time :2023/9/12 10:38
  25 + */
  26 +class CNoticeController extends BaseController
  27 +{
  28 + /**
  29 + * 更新通知C端
  30 + * @param Request $request
  31 + * @return \Illuminate\Http\JsonResponse
  32 + */
  33 + public function sendNotify(Request $request)
  34 + {
  35 + //获取当前项目的域名
  36 + $domainModel = new DomainInfo();
  37 + $domainInfo = $domainModel->read(['project_id'=>$this->param['project_id']]);
  38 + if($domainInfo === false){
  39 + //获取测试域名
  40 + $deployBuildModel = new DeployBuild();
  41 + $buildInfo = $deployBuildModel->read(['project_id'=>$this->param['project_id']]);
  42 + $this->param['domain'] = $buildInfo['test_domain'];
  43 + }else{
  44 + $this->param['domain'] = 'https://'.$domainInfo['domain'].'/';
  45 + }
  46 + $url = $this->param['domain'].'api/update_page/';
  47 + $param = [
  48 + 'project_id' => $this->param['project_id'],
  49 + 'type' => intval($request->input('type', 1)),
  50 + 'route' => intval($request->input('page', 1)),
  51 + 'url' => $request->input('url', []),
  52 + 'language'=> $request->input('language', []),
  53 + ];
  54 + http_post($url, json_encode($param));
  55 + $this->response('更新中请稍后, 更新完成将会发送站内信通知更新结果!');
  56 + }
  57 +
  58 +}
@@ -14,6 +14,7 @@ Route::middleware(['aloginauth'])->group(function () { @@ -14,6 +14,7 @@ Route::middleware(['aloginauth'])->group(function () {
14 Route::any('/editPassword', [Aside\Com\IndexController::class, 'editPassword'])->name('admin.editPassword.white'); 14 Route::any('/editPassword', [Aside\Com\IndexController::class, 'editPassword'])->name('admin.editPassword.white');
15 Route::get('/logout', [Aside\LoginController::class, 'logout'])->name('admin.logout.white'); 15 Route::get('/logout', [Aside\LoginController::class, 'logout'])->name('admin.logout.white');
16 Route::any('/getAccessAddress', [Aside\LoginController::class, 'getAccessAddress'])->name('admin.getAccessAddress');//获取B端地址 16 Route::any('/getAccessAddress', [Aside\LoginController::class, 'getAccessAddress'])->name('admin.getAccessAddress');//获取B端地址
  17 + Route::get('/sendNotify', [Aside\Com\CNoticeController::class, 'sendNotify'])->name('admin.sendNotify');
17 18
18 //会员相关 19 //会员相关
19 Route::prefix('user')->group(function () { 20 Route::prefix('user')->group(function () {