Commit 24b00f8d by 王召彬

判断是否是swoft1.x

parent 53323ce0
......@@ -2,8 +2,7 @@
namespace Hdll\Services\Common\Lib;
use Hdll\Services\Common\Config\CfgCenter;
use Swoft\App;
use Swoft\Redis\Redis;
use Hdll\Services\V2\Common\Config\CfgCenter as CfgCenter2;
class Xcrypt
{
......@@ -39,7 +38,11 @@ class Xcrypt
}
private static function getKey(){
$key = CfgCenter::getByOemId(CfgCenter::ENCRYPT_KEY, 0);
if(class_exists('\Swoft\App')) {
$key = CfgCenter::getByOemId(CfgCenter::ENCRYPT_KEY, 0);
} else {
$key = CfgCenter2::getByOemId(CfgCenter::ENCRYPT_KEY, 0);
}
if (empty($key)){
throw new \Exception('加密密钥获取失败!');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment