MtController.php 566 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace pt\controllers;
  3. use common\components\dict;
  4. use Shishaoqi\MeituanFlashPurchase\Application;
  5. use Yii;
  6. class MtController extends BaseController
  7. {
  8. public $guestAccess = ['bind'];
  9. public function actionBind()
  10. {
  11. $shopId = Yii::$app->request->get('id');
  12. $config = dict::getDict('mtConfig');
  13. $app = new Application($config);
  14. $appId = $config['app_id'] ?? '';
  15. $respond = $app->token->getAuthorizeCode($appId, $shopId);
  16. $result = json_decode($respond, true);
  17. print_r($result);
  18. }
  19. }