add tools request libs, migrate for hyperf framework
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Platform\Tools;
|
||||
|
||||
use function Hyperf\Config\config;
|
||||
|
||||
Trait RequestTrait
|
||||
{
|
||||
static function getHost() : string
|
||||
{
|
||||
|
||||
// is debug mode
|
||||
if(config('tools.debug', false)){
|
||||
// use tools test host
|
||||
return config('tools.host_test');
|
||||
}
|
||||
|
||||
return config('tools.host');
|
||||
}
|
||||
|
||||
static function getHash() : string
|
||||
{
|
||||
// is debug mode
|
||||
if(config('tools.debug', false)){
|
||||
// use tools test host
|
||||
return config('tools.token_test');
|
||||
}
|
||||
|
||||
return config('tools.token');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user