Skip to content

Commit 0ca81e0

Browse files
committed
no message
1 parent fca24ca commit 0ca81e0

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

routes/web.php

+1-22
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,7 @@
1212
*/
1313

1414
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;
15+
return 'Welcome LaravelAdmin';
3716
});
3817

3918
Route::get("/ddoc","Controller@getDdoc"); // 获取数据字典

0 commit comments

Comments
 (0)