作者 lyh

gx

... ... @@ -69,7 +69,6 @@ class ServerConfigLogic extends BaseLogic
*/
public function serviceConfigSave()
{
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($this->param, true) . PHP_EOL, FILE_APPEND);
$project = new Project();
$project_list = $project->read(['id'=>$this->param['project_id']]);
if($project_list === false){
... ...
... ... @@ -22,14 +22,7 @@ class ServerConfig extends Base
*/
protected $table = 'gl_server_config';
/**
* @var array
*/
protected $guarded = ['updated_at'];
const UPDATED_AT = null;
/**
* 1:服务器, 2:MySQL, 3:Redis
*/
... ... @@ -37,68 +30,5 @@ class ServerConfig extends Base
const TYPE_MYSQL = 2;
const TYPE_REDIS = 3;
/**
* @return string[]
* @author zbj
* @date 2023/4/23
*/
public static function typeMap(){
return [
self::TYPE_SERVER => '服务器',
self::TYPE_MYSQL => 'MySQL',
// self::TYPE_REDIS => 'Redis',
];
}
/**
* 用户名加密
* @param $value
*/
public function setUserAttribute($value)
{
$this->attributes['user'] = encrypt($value);
}
/**
* 密码加密
* @param $value
*/
public function setPasswordAttribute($value)
{
$this->attributes['password'] = encrypt($value);
}
/**
* 端口加密
* @param $value
*/
public function setPortAttribute($value)
{
$this->attributes['Port'] = encrypt($value);
}
/**
* @return mixed
*/
public function getUserAttribute($value)
{
return decrypt($value);
}
/**
* @return mixed
*/
public function getPasswordAttribute($value)
{
return decrypt($value);
}
/**
* @return mixed
*/
public function getPortAttribute($value)
{
return decrypt($value);
}
}
... ...