Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
services
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tencent
services
Commits
cbc8b72f
Commit
cbc8b72f
authored
Feb 11, 2019
by
xmy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:配置转移
主题发送日志修改
parent
6068f312
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
29 deletions
+21
-29
src/Cmq/Topic.php
+0
-0
src/Common/Config/CfgCenter.php
+1
-1
src/Common/Config/config.php
+16
-26
src/Common/Lib/Xcrypt.php
+4
-2
No files found.
src/Cmq/Topic.php
View file @
cbc8b72f
This diff is collapsed.
Click to expand it.
src/Common/Config/CfgCenter.php
View file @
cbc8b72f
...
...
@@ -68,7 +68,7 @@ class CfgCenter
return
[
trim
(
$rkey
,
':'
),
$valObj
];
}
p
rotected
static
function
dbConnect
()
p
ublic
static
function
dbConnect
()
{
if
(
\env
(
'ENVIRONMENT'
,
''
)
==
''
)
{
// 返回线上数据库连接
...
...
src/Common/Config/config.php
View file @
cbc8b72f
<?php
return
[
'qCloud'
=>
[
'Bucket'
=>
'hdll-1257143824'
,
'APPID'
=>
'1257143824'
,
'SecretId'
=>
'AKIDseHj18kua0KTSJ4g9SadbVEnEUZVjvPj'
,
'SecretKey'
=>
'IPL5g5PaaSAzd6NSO8gEmLxcN4pTzJSQ'
,
'Region'
=>
'ap-shanghai'
],
'alisms'
=>
[
'accessKeyId'
=>
'EjBn9zQxyEkKHyAA'
,
'accessKeySecret'
=>
'AN276rwCcqCkFUVt1GLCbAy8jnj52t'
,
],
'cls'
=>
[
'appid'
=>
'1257143824 '
,
'secretId'
=>
'AKIDseHj18kua0KTSJ4g9SadbVEnEUZVjvPj'
,
'secretKey'
=>
'IPL5g5PaaSAzd6NSO8gEmLxcN4pTzJSQ'
,
],
'cmq'
=>
[
'intranet_host'
=>
'http://cmq-topic-bj.api.tencentyun.com'
,
//内网
'internet_host'
=>
'https://cmq-topic-bj.api.qcloud.com'
,
//外网
'secretId'
=>
'AKIDYRW1cG2iVIg8dAoCe86vhNuA7A5oNknk'
,
'secretKey'
=>
'z0ymS7xfLrP6Sk2EKHWaXN6d0EIxX0IQ'
,
],
'cryptKey'
=>
'ebf032f01aa2093be3ee2ee2c137hdll'
,
];
\ No newline at end of file
namespace
Hdll\Services\Common\Config
;
use
Swoft\Redis\Redis
;
use
Swoft\App
;
const
CACHE_PREFIX
=
'CONFIG_CACHE'
;
$redis
=
App
::
getBen
(
Redis
::
class
);
$data
=
$redis
->
get
(
CACHE_PREFIX
.
'all'
);
if
(
!
empty
(
$data
))
{
$db
=
CfgCenter
::
dbConnect
();
$data
=
$db
->
select
(
'config'
,
[
'name'
,
'value'
]);
$redis
->
set
(
CACHE_PREFIX
.
'all'
,
$data
);
}
return
$data
;
\ No newline at end of file
src/Common/Lib/Xcrypt.php
View file @
cbc8b72f
<?php
namespace
Hdll\Services\Common\Lib
;
use
Hdll\Services\Common\Config\CfgCenter
;
use
Swoft\App
;
use
Swoft\Redis\Redis
;
...
...
@@ -41,8 +42,9 @@ class Xcrypt
}
private
static
function
getKey
(){
$redis
=
App
::
getBean
(
Redis
::
class
);
$key
=
$redis
->
get
(
self
::
CRYPT
);
// $redis = App::getBean(Redis::class);
// $key = $redis->get(self::CRYPT);
$key
=
CfgCenter
::
get
(
self
::
CRYPT
);
if
(
empty
(
$key
)){
throw
new
\Exception
(
'加密密钥获取失败!'
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment