|
@@ -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
|
} |