We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fca24ca commit 0ca81e0Copy full SHA for 0ca81e0
routes/web.php
@@ -12,28 +12,7 @@
12
*/
13
14
Route::get('/', function () {
15
- // 微信token认证
16
- $signature = $_GET["signature"];
17
- $timestamp = $_GET["timestamp"];
18
- $nonce = $_GET["nonce"];
19
- $echostr = $_GET["echostr"];
20
-
21
- // 你在微信公众号后台的设置的Token
22
- $token = "R3QGOqgF4LAje9M7HJAR1w1LM9kJr4wT";
23
24
- // 1)将token、timestamp、nonce三个参数进行字典序排序
25
- $tmpArr = array($nonce, $token, $timestamp);
26
- sort($tmpArr, SORT_STRING);
27
28
- // 2)将三个参数字符串拼接成一个字符串进行sha1加密
29
- $str = implode($tmpArr);
30
- $sign = sha1($str);
31
32
- // 3)开发者获得加密后的字符串可与signature对比,标识该请求来源于微信
33
- if ($sign == $signature) {
34
- echo $echostr;
35
- }
36
- // return null;
+ return 'Welcome LaravelAdmin';
37
});
38
39
Route::get("/ddoc","Controller@getDdoc"); // 获取数据字典
0 commit comments