|
@@ -10,6 +10,7 @@ use App\Models\Devops\DevopsTask; |
|
@@ -10,6 +10,7 @@ use App\Models\Devops\DevopsTask; |
|
10
|
use App\Models\Project\Project;
|
10
|
use App\Models\Project\Project;
|
|
11
|
use App\Models\Devops\ServerConfig;
|
11
|
use App\Models\Devops\ServerConfig;
|
|
12
|
use App\Services\ProjectServer;
|
12
|
use App\Services\ProjectServer;
|
|
|
|
13
|
+use App\Utils\EncryptUtils;
|
|
13
|
use Illuminate\Support\Facades\DB;
|
14
|
use Illuminate\Support\Facades\DB;
|
|
14
|
|
15
|
|
|
15
|
/**
|
16
|
/**
|
|
@@ -47,7 +48,11 @@ class ServerConfigLogic extends BaseLogic |
|
@@ -47,7 +48,11 @@ class ServerConfigLogic extends BaseLogic |
|
47
|
* @time :2023/8/2 17:53
|
48
|
* @time :2023/8/2 17:53
|
|
48
|
*/
|
49
|
*/
|
|
49
|
public function getServiceConfig(){
|
50
|
public function getServiceConfig(){
|
|
|
|
51
|
+ $encrypt = new EncryptUtils();
|
|
50
|
$info = $this->model->read(['id'=>$this->param['id']]);
|
52
|
$info = $this->model->read(['id'=>$this->param['id']]);
|
|
|
|
53
|
+ $info['account'] = $encrypt->unlock_url($this->param['account']);
|
|
|
|
54
|
+ $info['password'] = $encrypt->unlock_url($this->param['password']);
|
|
|
|
55
|
+ $this->param['port'] = $encrypt->unlock_url($this->param['port']);
|
|
51
|
if($info === false){
|
56
|
if($info === false){
|
|
52
|
$this->fail('当前数据不存在或者被删除');
|
57
|
$this->fail('当前数据不存在或者被删除');
|
|
53
|
}
|
58
|
}
|
|
@@ -65,6 +70,10 @@ class ServerConfigLogic extends BaseLogic |
|
@@ -65,6 +70,10 @@ class ServerConfigLogic extends BaseLogic |
|
65
|
{
|
70
|
{
|
|
66
|
DB::beginTransaction();
|
71
|
DB::beginTransaction();
|
|
67
|
try {
|
72
|
try {
|
|
|
|
73
|
+ $encrypt = new EncryptUtils();
|
|
|
|
74
|
+ $this->param['account'] = $encrypt->lock_url($this->param['account']);
|
|
|
|
75
|
+ $this->param['password'] = $encrypt->lock_url($this->param['password']);
|
|
|
|
76
|
+ $this->param['port'] = $encrypt->lock_url($this->param['port']);
|
|
68
|
//保存配置
|
77
|
//保存配置
|
|
69
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
78
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
70
|
$this->model->edit($this->param,['id'=>$this->param['id']]);
|
79
|
$this->model->edit($this->param,['id'=>$this->param['id']]);
|
|
@@ -125,11 +134,6 @@ class ServerConfigLogic extends BaseLogic |
|
@@ -125,11 +134,6 @@ class ServerConfigLogic extends BaseLogic |
|
125
|
if($rs === false){
|
134
|
if($rs === false){
|
|
126
|
$this->fail('删除失败');
|
135
|
$this->fail('删除失败');
|
|
127
|
}
|
136
|
}
|
|
128
|
- //TODO::上线放开
|
|
|
|
129
|
-// if($info['type'] == $this->model::TYPE_MYSQL){
|
|
|
|
130
|
-// $sql = 'DROP DATABASE '.$info['title'];
|
|
|
|
131
|
-// DB::connection('custom_mysql')->statement($sql);
|
|
|
|
132
|
-// }
|
|
|
|
133
|
return $this->success();
|
137
|
return $this->success();
|
|
134
|
}
|
138
|
}
|
|
135
|
|
139
|
|