<?php
//作为外部调用的第一个页面
include "wxid/wechat.class.php";
include 'wxid/errCode.php';
require_once("Wx.Config.php");
$httppath = WxMainConfig::ServerHttpPath;

$scope = 'snsapi_base';
$strDListID=trim($_REQUEST['dlistid']);	//部门流水号
$strTableNo=trim($_REQUEST['tableno']);	//桌台号

if($strMCHID=='')
{
	$strMCHID=0;
}

$opt = array(
	'appsecret'=>WxMainConfig::APPSECRET,//填写高级调用功能的密钥
	'appid'=>WxMainConfig::APPID	//填写高级调用功能的appid
);

$we = new Wechat($opt);
//$auth = $we->checkAuth();
//$arr = $we->getOauthAccessToken();

//echo $arr["access_token"];
//echo 'openid='.$arr["openid"]; 
$oauth_url =  $we->getOauthRedirect($httppath.'posscanb.php?dlistid='.$strDListID.'&tableno='.$strTableNo,"wxbase",$scope);
header('Location: ' . $oauth_url);
?>
