Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6
正在显示
3 个修改的文件
包含
34 行增加
和
2 行删除
| @@ -4,6 +4,7 @@ namespace App\Http\Controllers\Api; | @@ -4,6 +4,7 @@ namespace App\Http\Controllers\Api; | ||
| 4 | 4 | ||
| 5 | use App\Exceptions\InquiryFilterException; | 5 | use App\Exceptions\InquiryFilterException; |
| 6 | use App\Models\Mail\Mail; | 6 | use App\Models\Mail\Mail; |
| 7 | +use App\Models\Project\DeployBuild; | ||
| 7 | use App\Models\Project\Project; | 8 | use App\Models\Project\Project; |
| 8 | use App\Models\User\User; | 9 | use App\Models\User\User; |
| 9 | use App\Models\Visit\SyncSubmitTask; | 10 | use App\Models\Visit\SyncSubmitTask; |
| @@ -124,4 +125,36 @@ class SelfSiteController extends BaseController | @@ -124,4 +125,36 @@ class SelfSiteController extends BaseController | ||
| 124 | 125 | ||
| 125 | return $this->success([]); | 126 | return $this->success([]); |
| 126 | } | 127 | } |
| 128 | + | ||
| 129 | + /** | ||
| 130 | + * 自建站上传验证文件接口 | ||
| 131 | + * @param Request $request | ||
| 132 | + * @return false|string | ||
| 133 | + * @author Akun | ||
| 134 | + * @date 2024/05/28 11:47 | ||
| 135 | + */ | ||
| 136 | + public function selfSiteVerify(Request $request) | ||
| 137 | + { | ||
| 138 | + $token = $request->header('token');//token | ||
| 139 | + $pid = $request->header('pid');//项目id | ||
| 140 | + $file_name = $request->input('file_name');//验证文件名称 | ||
| 141 | + $type = $request->input('type');//验证文件类型,1主站,2小语种站 | ||
| 142 | + | ||
| 143 | + if (empty($token) || empty($pid)) { | ||
| 144 | + return $this->error('token无效', 401); | ||
| 145 | + } | ||
| 146 | + | ||
| 147 | + //判断token是否有效 | ||
| 148 | + $project_model = new Project(); | ||
| 149 | + $project_info = $project_model->read(['id' => $pid, 'site_token' => $token]); | ||
| 150 | + if (!$project_info) { | ||
| 151 | + return $this->error('token无效', 401); | ||
| 152 | + } | ||
| 153 | + | ||
| 154 | + $model = new DeployBuild(); | ||
| 155 | + $data = $type == 1 ? ['main_verify_file' => $file_name] : ['amp_verify_file' => $file_name]; | ||
| 156 | + $model->edit($data, ['project_id' => $pid]); | ||
| 157 | + | ||
| 158 | + return $this->success([]); | ||
| 159 | + } | ||
| 127 | } | 160 | } |
| @@ -264,8 +264,6 @@ class ProjectLogic extends BaseLogic | @@ -264,8 +264,6 @@ class ProjectLogic extends BaseLogic | ||
| 264 | protected function saveProjectDeployBuild($deploy_build){ | 264 | protected function saveProjectDeployBuild($deploy_build){ |
| 265 | $deployBuildModel = new DeployBuild(); | 265 | $deployBuildModel = new DeployBuild(); |
| 266 | $deploy_build['configuration'] = Arr::a2s(!empty($deploy_build['configuration']) ? $deploy_build['configuration'] : []); | 266 | $deploy_build['configuration'] = Arr::a2s(!empty($deploy_build['configuration']) ? $deploy_build['configuration'] : []); |
| 267 | - $deploy_build['main_verify_file'] = $deploy_build['main_verify_file'] ?? ''; | ||
| 268 | - $deploy_build['amp_verify_file'] = $deploy_build['amp_verify_file'] ?? ''; | ||
| 269 | $deployBuildModel->edit($deploy_build,['id'=>$deploy_build['id']]); | 267 | $deployBuildModel->edit($deploy_build,['id'=>$deploy_build['id']]); |
| 270 | return $this->success(); | 268 | return $this->success(); |
| 271 | } | 269 | } |
| @@ -38,5 +38,6 @@ Route::any('getAutoToken', [\App\Http\Controllers\Api\PrivateController::class, | @@ -38,5 +38,6 @@ Route::any('getAutoToken', [\App\Http\Controllers\Api\PrivateController::class, | ||
| 38 | //自建站接口转接 | 38 | //自建站接口转接 |
| 39 | Route::post('selfSiteApi', [\App\Http\Controllers\Api\SelfSiteController::class, 'selfSiteApi']); | 39 | Route::post('selfSiteApi', [\App\Http\Controllers\Api\SelfSiteController::class, 'selfSiteApi']); |
| 40 | Route::post('selfSiteNotify', [\App\Http\Controllers\Api\SelfSiteController::class, 'selfSiteNotify']); | 40 | Route::post('selfSiteNotify', [\App\Http\Controllers\Api\SelfSiteController::class, 'selfSiteNotify']); |
| 41 | +Route::post('selfSiteVerify', [\App\Http\Controllers\Api\SelfSiteController::class, 'selfSiteVerify']); | ||
| 41 | 42 | ||
| 42 | 43 |
-
请 注册 或 登录 后发表评论