Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6
正在显示
6 个修改的文件
包含
33 行增加
和
12 行删除
| @@ -55,7 +55,7 @@ class InitProject extends Command | @@ -55,7 +55,7 @@ class InitProject extends Command | ||
| 55 | $project = Project::find($item['data']['project_id']); | 55 | $project = Project::find($item['data']['project_id']); |
| 56 | $project_logic = new ProjectLogic(); | 56 | $project_logic = new ProjectLogic(); |
| 57 | //初始化数据库 | 57 | //初始化数据库 |
| 58 | - if(!empty($project['mysql_id'])){ | 58 | + if(!empty($project['mysql_id']) && ($project['type'] == 1)){ |
| 59 | $project_logic->initializationMysql($project['id']); | 59 | $project_logic->initializationMysql($project['id']); |
| 60 | } | 60 | } |
| 61 | //初始账号 | 61 | //初始账号 |
| @@ -31,6 +31,10 @@ class NoticeController extends BaseController | @@ -31,6 +31,10 @@ class NoticeController extends BaseController | ||
| 31 | $referrer_url = $request->input('referrer_url'); | 31 | $referrer_url = $request->input('referrer_url'); |
| 32 | $user_agent = $request->input('user_agent'); | 32 | $user_agent = $request->input('user_agent'); |
| 33 | 33 | ||
| 34 | + // 数据占时不入库, 些日志分析数据 | ||
| 35 | + file_put_contents(storage_path('logs/trafficVisit.log'), var_export($request->all(), true) . PHP_EOL, FILE_APPEND); | ||
| 36 | +// return $this->success([]); | ||
| 37 | + | ||
| 34 | if (empty($ip)) | 38 | if (empty($ip)) |
| 35 | return $this->error('IP不能为空'); | 39 | return $this->error('IP不能为空'); |
| 36 | if (empty($url)) | 40 | if (empty($url)) |
| @@ -38,7 +42,6 @@ class NoticeController extends BaseController | @@ -38,7 +42,6 @@ class NoticeController extends BaseController | ||
| 38 | if (empty($user_agent)) | 42 | if (empty($user_agent)) |
| 39 | return $this->error('请求头信息user_agent不能为空'); | 43 | return $this->error('请求头信息user_agent不能为空'); |
| 40 | 44 | ||
| 41 | - // | ||
| 42 | $url_array = parse_url($url); | 45 | $url_array = parse_url($url); |
| 43 | $array = [ | 46 | $array = [ |
| 44 | 'ip' => $ip, | 47 | 'ip' => $ip, |
| @@ -12,6 +12,7 @@ namespace App\Http\Controllers\Aside\Com; | @@ -12,6 +12,7 @@ namespace App\Http\Controllers\Aside\Com; | ||
| 12 | use App\Helper\Common; | 12 | use App\Helper\Common; |
| 13 | use App\Http\Controllers\Bside\BaseController; | 13 | use App\Http\Controllers\Bside\BaseController; |
| 14 | use App\Models\Com\UpdateLog; | 14 | use App\Models\Com\UpdateLog; |
| 15 | +use App\Models\Com\UpdateOldInfo; | ||
| 15 | use App\Models\Domain\DomainInfo; | 16 | use App\Models\Domain\DomainInfo; |
| 16 | use App\Models\Project\ProjectUpdateTdk; | 17 | use App\Models\Project\ProjectUpdateTdk; |
| 17 | use App\Services\ProjectServer; | 18 | use App\Services\ProjectServer; |
| @@ -75,9 +76,26 @@ class UpdateController extends BaseController | @@ -75,9 +76,26 @@ class UpdateController extends BaseController | ||
| 75 | $this->fail('非升级无法进行采集操作'); | 76 | $this->fail('非升级无法进行采集操作'); |
| 76 | } | 77 | } |
| 77 | 78 | ||
| 79 | + $test_domain = $this->param['test_domain'] ?? ''; | ||
| 80 | + if ($test_domain) { | ||
| 81 | + $test_domain_arr = parse_url($test_domain); | ||
| 82 | + $test_domain = $test_domain_arr['host'] ?? ''; | ||
| 83 | + } | ||
| 84 | + | ||
| 85 | + //查看项目是否已上线 | ||
| 86 | + $domain_info = DomainInfo::where('project_id', $this->param['project_id'])->first(); | ||
| 87 | + | ||
| 88 | + if ($domain_info && !$test_domain) { | ||
| 89 | + $this->fail('已上线项目需填写采集的测试站域名'); | ||
| 90 | + } | ||
| 91 | + | ||
| 78 | try { | 92 | try { |
| 79 | DB::connection('custom_mysql')->statement("DELETE FROM `gl_collect_source` WHERE `origin` LIKE '%.css%' OR `origin` LIKE '%.js%'"); | 93 | DB::connection('custom_mysql')->statement("DELETE FROM `gl_collect_source` WHERE `origin` LIKE '%.css%' OR `origin` LIKE '%.js%'"); |
| 80 | - DB::connection('custom_mysql')->statement("UPDATE `gl_collect_task` SET `status` = 0 WHERE `language` = ''"); | 94 | + if ($domain_info) { |
| 95 | + DB::connection('custom_mysql')->statement("UPDATE `gl_collect_task` SET `status` = 0,`domain` = '" . $test_domain . "' WHERE `language` = ''"); | ||
| 96 | + } else { | ||
| 97 | + DB::connection('custom_mysql')->statement("UPDATE `gl_collect_task` SET `status` = 0 WHERE `language` = ''"); | ||
| 98 | + } | ||
| 81 | } catch (\Exception $e) { | 99 | } catch (\Exception $e) { |
| 82 | errorLog('重新采集升级项目数据', $this->param, $e); | 100 | errorLog('重新采集升级项目数据', $this->param, $e); |
| 83 | 101 | ||
| @@ -87,9 +105,6 @@ class UpdateController extends BaseController | @@ -87,9 +105,6 @@ class UpdateController extends BaseController | ||
| 87 | //关闭数据库 | 105 | //关闭数据库 |
| 88 | DB::disconnect('custom_mysql'); | 106 | DB::disconnect('custom_mysql'); |
| 89 | 107 | ||
| 90 | - //查看项目是否已上线 | ||
| 91 | - $domain_info = DomainInfo::where('project_id', $this->param['project_id'])->first(); | ||
| 92 | - | ||
| 93 | $update = ['collect_status' => 0]; | 108 | $update = ['collect_status' => 0]; |
| 94 | if ($this->param['type'] == 2 && !$domain_info) { | 109 | if ($this->param['type'] == 2 && !$domain_info) { |
| 95 | $update['status'] = 0; | 110 | $update['status'] = 0; |
| @@ -212,8 +212,8 @@ class ProofreadingController extends BaseController | @@ -212,8 +212,8 @@ class ProofreadingController extends BaseController | ||
| 212 | $data[] = $trimmedString; | 212 | $data[] = $trimmedString; |
| 213 | } | 213 | } |
| 214 | $data = array_values($data); | 214 | $data = array_values($data); |
| 215 | - $uniqueArray = array_unique($data); | ||
| 216 | - $data = array_values($uniqueArray); | 215 | +// $uniqueArray = array_unique($data); |
| 216 | +// $data = array_values($uniqueArray); | ||
| 217 | return $data; | 217 | return $data; |
| 218 | } | 218 | } |
| 219 | 219 |
| @@ -105,7 +105,7 @@ class ProjectServer | @@ -105,7 +105,7 @@ class ProjectServer | ||
| 105 | $created_at = date('Y-m-d H:i:s'); | 105 | $created_at = date('Y-m-d H:i:s'); |
| 106 | self::initGroup($project_id,$created_at); | 106 | self::initGroup($project_id,$created_at); |
| 107 | //初始化单页 | 107 | //初始化单页 |
| 108 | - self::init404Page($project_id); | 108 | + self::init404Page($project_id,$created_at); |
| 109 | //初始化模块数据 | 109 | //初始化模块数据 |
| 110 | self::initModule($project_id); | 110 | self::initModule($project_id); |
| 111 | DB::disconnect('custom_mysql'); | 111 | DB::disconnect('custom_mysql'); |
| @@ -172,7 +172,7 @@ class ProjectServer | @@ -172,7 +172,7 @@ class ProjectServer | ||
| 172 | * @method :post | 172 | * @method :post |
| 173 | * @time :2023/12/29 9:32 | 173 | * @time :2023/12/29 9:32 |
| 174 | */ | 174 | */ |
| 175 | - public function init404Page($project_id){ | 175 | + public function init404Page($project_id,$created_at){ |
| 176 | $info = DB::connection('custom_mysql')->table('gl_web_custom_template')->first(); | 176 | $info = DB::connection('custom_mysql')->table('gl_web_custom_template')->first(); |
| 177 | if(empty($info)) { | 177 | if(empty($info)) { |
| 178 | $main_404_html = '<main> | 178 | $main_404_html = '<main> |
| @@ -208,7 +208,10 @@ class ProjectServer | @@ -208,7 +208,10 @@ class ProjectServer | ||
| 208 | 'status' => 1, | 208 | 'status' => 1, |
| 209 | 'url' => BCustomTemplate::NOT_FOUND_PAGE_URL, | 209 | 'url' => BCustomTemplate::NOT_FOUND_PAGE_URL, |
| 210 | 'html' => $main_404_html, | 210 | 'html' => $main_404_html, |
| 211 | - 'html_style' => '<style id="globalsojs-styles"></style>','title' => '404-Page not found', 'description' => 'Sorry. The page has either moved or cannot be found.', 'created_at' => $created_at, 'updated_at' => $created_at]; | 211 | + 'html_style' => '<style id="globalsojs-styles"></style>', |
| 212 | + 'title' => '404-Page not found', | ||
| 213 | + 'description' => 'Sorry. The page has either moved or cannot be found.', | ||
| 214 | + 'created_at' => $created_at, 'updated_at' => $created_at]; | ||
| 212 | $id = DB::connection('custom_mysql')->table('gl_web_custom_template')->insertGetId($data); | 215 | $id = DB::connection('custom_mysql')->table('gl_web_custom_template')->insertGetId($data); |
| 213 | //路由 | 216 | //路由 |
| 214 | $info = DB::connection('custom_mysql')->table('gl_route_map')->first(); | 217 | $info = DB::connection('custom_mysql')->table('gl_route_map')->first(); |
| @@ -357,7 +357,7 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -357,7 +357,7 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 357 | //无需登录验证的路由组 | 357 | //无需登录验证的路由组 |
| 358 | Route::group([], function () { | 358 | Route::group([], function () { |
| 359 | Route::any('/login', [Aside\LoginController::class, 'login'])->name('admin.login.white'); | 359 | Route::any('/login', [Aside\LoginController::class, 'login'])->name('admin.login.white'); |
| 360 | - Route::any('/image/{hash}/{w?}/{h?}', [\App\Http\Controllers\File\ImageController::class, 'index'])->name('admin.image_show'); | 360 | +// Route::any('/image/{hash}/{w?}/{h?}', [\App\Http\Controllers\File\ImageController::class, 'index'])->name('admin.image_show'); |
| 361 | Route::any('/file/{hash}', [\App\Http\Controllers\File\FileController::class, 'index'])->name('admin.file_show'); | 361 | Route::any('/file/{hash}', [\App\Http\Controllers\File\FileController::class, 'index'])->name('admin.file_show'); |
| 362 | Route::any('/download_files', [\App\Http\Controllers\File\FileController::class, 'downLoad'])->name('admin.files_downLoad');//导出文件 | 362 | Route::any('/download_files', [\App\Http\Controllers\File\FileController::class, 'downLoad'])->name('admin.files_downLoad');//导出文件 |
| 363 | Route::any('/download_images', [\App\Http\Controllers\File\ImageController::class, 'downLoad'])->name('admin.images_downLoad');//导出图片 | 363 | Route::any('/download_images', [\App\Http\Controllers\File\ImageController::class, 'downLoad'])->name('admin.images_downLoad');//导出图片 |
-
请 注册 或 登录 后发表评论