WxShareController.php 494 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace client\controllers;
  3. use common\components\jsSDK;
  4. use common\components\util;
  5. use Yii;
  6. class WxShareController extends BaseController
  7. {
  8. //取微信分享的参数 shish 2020.2.22
  9. public function actionGetParams()
  10. {
  11. if ($this->isWx) {
  12. util::fail('不是微信环境');
  13. }
  14. $url = Yii::$app->request->get('url');
  15. $jsSDK = new jsSDK();//微信分享
  16. $merchant = $this->merchant;
  17. $return = $jsSDK->GetSignPackage($merchant, $url);
  18. util::success($return);
  19. }
  20. }