-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauth.php
More file actions
30 lines (29 loc) · 815 Bytes
/
auth.php
File metadata and controls
30 lines (29 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
define('FoundPHP.com',true);
$code = trim($_GET['code']);
$_dev_echostr = trim($_GET['echostr']);
$_dev_signature = trim($_GET['signature']);
$_dev_timestamp = trim($_GET['timestamp']);
$_dev_nonce = trim($_GET['nonce']);
$_dev_msgsign = trim($_GET['msg_signature']);
include_once "plugin/controller.php";
//实例微信库
$wx = load('class/wechat/service','FoundPHP_wechat_service',$config['wx']);
//实例数据库
$db = load('class/database/dbo','FoundPHP_dbo',$config['db']);
switch($m){
//用户资料
case'user':
//获得用户信息
$usinfo = $wx->usinfo($code);
//访问模块
$wx->auth_view($t);
break;
default:
//服务号认证
if(!empty($t)){
$wx->auth();
}else{
empty($_dev_echostr)?$wx->dev_valid():$wx->dev_msg();exit;
}
}