作者 lyh
@@ -42,12 +42,11 @@ class SelfSiteController extends BaseController @@ -42,12 +42,11 @@ class SelfSiteController extends BaseController
42 } 42 }
43 43
44 //判断token是否有效 44 //判断token是否有效
45 - $project_model = new Project();  
46 - $project_info = $project_model->read(['site_token' => $token]); 45 + $project_info = Project::with('domainInfo')->where('site_token',$token)->first();
47 if (!$project_info) { 46 if (!$project_info) {
48 return $this->error('token无效', 401); 47 return $this->error('token无效', 401);
49 } 48 }
50 - if (($project_info['domainInfo']['domain'] ?? '') != $domain) { 49 + if (($project_info->domainInfo->domain ?? '') != $domain) {
51 return $this->error('token无效', 401); 50 return $this->error('token无效', 401);
52 } 51 }
53 52