<?php

//namespace zjhj_mall;
$entry = '/public/';

if (file_exists(__DIR__ . $entry)) {
    global $_W;
    $wUser = [
        'uid' => $_W['user']['uid'],
        'name' => $_W['user']['name'],
        'username' => $_W['user']['username'],
        'groupid' => $_W['user']['groupid'],
    ];
    $wAccount = [
        'acid' => $_W['account']['acid'],
        'name' => $_W['account']['name'],
    ];

    require __DIR__ . '/vendor/autoload.php';
    $request = new Illuminate\Http\Request;
    session_start();
    $_SESSION["store_id"] = $_W['uniacid'];
    $_SESSION["wUser"] = $wUser;
    $_SESSION["wAccount"] = $wAccount;
    $_SESSION["route"] = 'Admin/Auth/Login/wxLogin';
    $uri = $_W['siteroot'] . 'addons/' . $_W['current_module']['name'] . $entry .'?route=Admin/Auth/Login/wxLogin';
    header('Location: ' . $uri);
    exit;
} else {
    die('应用入口文件缺失，请联系开发者处理！');
}