ServerConfig.php
1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
/**
* Created by PhpStorm.
* User: zhl
* Date: 2023/4/17
* Time: 10:04
*/
namespace App\Models\Devops;
use App\Helper\Arr;
use App\Models\Base;
use App\Utils\EncryptUtils;
/**
* 服务账户信息
* Class ServeConfig
* @package App\Models
*/
class ServerConfig extends Base
{
/**
* @var string
*/
protected $table = 'gl_server_config';
/**
* 1:服务器, 2:MySQL, 3:Redis
*/
const TYPE_SERVER = 1;
const TYPE_MYSQL = 2;
const TYPE_REDIS = 3;
const STATUS_ONE = 1;
const SELF_SITE_ID = 8;//自建站服务器ID
/**
* @remark :获取数据用户名解密
* @name :getUserAttribute
* @author :lyh
* @method :post
* @time :2023/9/12 16:05
*/
public function getUserAttribute($value){
return (new EncryptUtils())->unlock_url($value);
}
/**
* @remark :密码解密
* @name :getPasswordAttribute
* @author :lyh
* @method :post
* @time :2023/9/12 16:05
*/
public function getPasswordAttribute($value){
return (new EncryptUtils())->unlock_url($value);
}
/**
* @remark :端口解密
* @name :getPasswordAttribute
* @author :lyh
* @method :post
* @time :2023/9/12 16:05
*/
public function getPortAttribute($value){
return (new EncryptUtils())->unlock_url($value);
}
}