作者 lyh

gx

@@ -22,6 +22,7 @@ use App\Models\Project\Payment; @@ -22,6 +22,7 @@ use App\Models\Project\Payment;
22 use App\Models\Project\Project; 22 use App\Models\Project\Project;
23 use App\Models\Task\Task; 23 use App\Models\Task\Task;
24 use App\Utils\EncryptUtils; 24 use App\Utils\EncryptUtils;
  25 +use Hashids\Hashids;
25 use Illuminate\Support\Facades\Cache; 26 use Illuminate\Support\Facades\Cache;
26 use Illuminate\Support\Facades\DB; 27 use Illuminate\Support\Facades\DB;
27 28
@@ -180,6 +181,9 @@ class ProjectLogic extends BaseLogic @@ -180,6 +181,9 @@ class ProjectLogic extends BaseLogic
180 } 181 }
181 $data = $param['deploy_build']; 182 $data = $param['deploy_build'];
182 $data['project_id'] = $param['id']; 183 $data['project_id'] = $param['id'];
  184 + $hashids = new Hashids('test_domain', 5, 'abcdefghjkmnpqrstuvwxyz1234567890');
  185 + $code = $hashids->encode($this->project_id);
  186 + $data['test_domain'] = 'v6-' . $code . '.globalso.site';
183 $data['id'] = DeployBuild::where('project_id', $param['id'])->value('id'); 187 $data['id'] = DeployBuild::where('project_id', $param['id'])->value('id');
184 // Arr::forget($data, ['test_domain', 'plan']); 188 // Arr::forget($data, ['test_domain', 'plan']);
185 return (new DeployBuildLogic)->save($data); 189 return (new DeployBuildLogic)->save($data);
@@ -22,12 +22,12 @@ class DeployBuild extends Base @@ -22,12 +22,12 @@ class DeployBuild extends Base
22 return Arr::setToArr($value, 'trim'); 22 return Arr::setToArr($value, 'trim');
23 } 23 }
24 24
25 - public function getTestDomainAttribute(): string  
26 - {  
27 - $hashids = new Hashids('test_domain', 5, 'abcdefghjkmnpqrstuvwxyz1234567890');  
28 - $code = $hashids->encode($this->project_id);  
29 - return 'https://v6-' . $code . '.globalso.site';  
30 - } 25 +// public function getTestDomainAttribute(): string
  26 +// {
  27 +// $hashids = new Hashids('test_domain', 5, 'abcdefghjkmnpqrstuvwxyz1234567890');
  28 +// $code = $hashids->encode($this->project_id);
  29 +// return 'https://v6-' . $code . '.globalso.site';
  30 +// }
31 31
32 public static function clearCache($row){ 32 public static function clearCache($row){
33 $cache_key = 'project_' . $row->original['test_domain']; 33 $cache_key = 'project_' . $row->original['test_domain'];