You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

18 lines
565 B

  1. <?php
  2. /*
  3. Author:XM
  4. Compeny:Spiders Travel
  5. */
  6. //获取jssdk配置
  7. require_once __DIR__.'/../jssdk/jssdk_wx.php';
  8. require_once __DIR__.'/../Common/Config.php';
  9. header("Access-Control-Allow-Origin:*");
  10. $jssdk = new JSSDK(APPID, APPSECRET);
  11. if (isset($_POST['url'])){
  12. $url=$_POST['url'];
  13. }else{
  14. $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
  15. $url = "$protocol$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
  16. }
  17. $signPackage = $jssdk->GetSignPackage($url);
  18. echo json_encode($signPackage);