<?php
//外部调用第一个页面后,自动调转到该页面,由该页面实际完成调用应用的起始页面
include "wxid/wechat.class.php";
include 'wxid/errCode.php';
require_once("../Wx.Config.php");
$httppath = WxMainConfig::ServerHttpPath;

//$strselchid=trim($_REQUEST['chidno']);
//$chsel=trim($_REQUEST['chsel']);

$scope = 'snsapi_base';

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

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

$bqurl=$httppath.'wxmall/loadpage.php?wxudid='.$arr["openid"];
header('Location: ' . $bqurl);

?>