作者 刘锟

Merge remote-tracking branch 'origin/master' into akun

@@ -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,
@@ -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');//导出图片