Просмотр исходного кода

Merge branch 'zhongqi-delivery'

shizhongqi 7 месяцев назад
Родитель
Сommit
3f6eaace37

+ 2 - 3
common/components/delivery/platform/dada/Auth.php

@@ -39,14 +39,13 @@ class Auth
      */
     public function __construct($mainId)
     {
-        $isProduction = getenv('YII_ENV') == 'dev'; // TODO  如果是 dev 请修改为 production
+        $isProduction = getenv('YII_ENV') == 'production';
         
         if ($isProduction) {
             // 生产环境配置
             $this->appKey = 'dadaf2279d901a5ba40';
             $this->appSecret = '828a03677a1c00a3a5b3c59209c4433d';
-            // TODO
-            $this->redirectUri = 'https://api.shop.hzghd.com' . '/delivery/dada-auth-callback?mainId='.$mainId; // TODO Yii::$app->params['ghsHost'].'/delivery/dada-auth-callback?mainId='.$mainId;
+            $this->redirectUri = Yii::$app->params['ghsHost'].'/delivery/dada-auth-callback?mainId='.$mainId; //'https://api.shop.hzghd.com' . '/delivery/dada-auth-callback?mainId='.$mainId;
             $this->authorizeUrl = self::AUTHORIZE_URL_PROD;
             $this->tokenUrl = self::TOKEN_URL_PROD;
         } else {

+ 1 - 0
common/components/delivery/services/AuthService.php

@@ -87,6 +87,7 @@ Class AuthService{
         if(isset($ret['raw']) && $ret['raw']['code'] == 200){
             util::success(['url'=>$ret['raw']['data']['authUrl']]);
         }else{
+            Yii::error('滴滴获取授权地址失败:' . json_encode($ret));
             util::fail('获取授权地址失败');
         }
     }