stanley-king 4 роки тому
батько
коміт
8b39850b58
2 змінених файлів з 18 додано та 1 видалено
  1. 1 1
      helper/fcgi_server.php
  2. 17 0
      mobile/signature.php

+ 1 - 1
helper/fcgi_server.php

@@ -27,7 +27,7 @@ class fcgi_server
         static $exfiles = ['web_wxnotify.php',
             'wxnotify.php','pub_wxnotify.php','alipay_notify_url.php','dispatch_notify.php','kdniao_notify.php',
             'cmbpay_notify.php','cmbpay_sign.php','wxauthor.php','api/wxLogin/index.php','api/wxLogin/callback.php',
-            'test.php'];
+            'signature.php'];
         $path = BASE_ROOT_PATH . '/mobile/';
         $file = str_replace($path,'',$file);
 

+ 17 - 0
mobile/signature.php

@@ -0,0 +1,17 @@
+<?php
+
+$signature = $_GET["signature"];
+$timestamp = $_GET["timestamp"];
+$nonce = $_GET["nonce"];
+
+$token = 'stanleykinghelloworld';
+$tmpArr = array($token, $timestamp, $nonce);
+sort($tmpArr, SORT_STRING);
+$tmpStr = implode( $tmpArr );
+$tmpStr = sha1( $tmpStr );
+
+if( $tmpStr == $signature ){
+    return true;
+}else{
+    return false;
+}