|
@@ -45,6 +45,11 @@ class SupplyService extends BaseService
|
|
|
public function __construct()
|
|
|
{
|
|
|
$this->model = new GoodsModel();
|
|
|
+
|
|
|
+ self::$apiUrl = ConfigService::make()->getConfigByCode('supply_api_url','https://www.douhuomall.com');
|
|
|
+ self::$supplyMobile = ConfigService::make()->getConfigByCode('supply_mobile','19354894149');
|
|
|
+ self::$appId = ConfigService::make()->getConfigByCode('supply_app_id','YS1ef14c155555dce4bb');
|
|
|
+ self::$appSecret = ConfigService::make()->getConfigByCode('supply_app_secret','2cbbf72408cb906ec039105d9ff9b365');
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -67,6 +72,10 @@ class SupplyService extends BaseService
|
|
|
*/
|
|
|
public function getToken()
|
|
|
{
|
|
|
+ if(empty(self::$appId) || empty(self::$supplyMobile) || empty(self::$appSecret)){
|
|
|
+ $this->error = 2702;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
$cacheKey = "caches:supply:token_".self::$appId.'_'.self::$supplyMobile;
|
|
|
$data = RedisService::get($cacheKey);
|
|
|
$accessToken = isset($data['access_token'])? $data['access_token'] : '';
|