canyin-project/ybcy/module.php

49 lines
1.8 KiB
PHP
Raw Normal View History

2024-11-01 16:07:54 +08:00
<?php
/**
* mg_jz模块定义
*
* @author 云贝网络
* @url
*/
defined('IN_IA') or exit('Access Denied');
class Yb_wmModule extends WeModule {
public function welcomeDisplay() {
//var_dump(__DIR__);die;
$entry = '/index.php';
if (file_exists(__DIR__ . $entry)){
//从微擎入口module存储菜单id和用户信息
global $_W;
$configData=array(
'uid' => $_W['user']['uid'],
'name' => $_W['user']['name'],
'username' => $_W['user']['username'],
'uniacid'=> $_W['uniacid'],
'acid' => $_W['account']['acid'],
'account_name' => $_W['account']['name'],
'module'=>$_W['current_module']['name'],
'version_id'=>$_GET['version_id'],
);
if ($configData['name'] === null || $configData['name'] === '') {
$configData['name'] = $configData['username'];
}
$userData['wqUid']=$_W['user']['uid'];
$userData['userName']=$configData['name'];
$userData['loginType']=1;//入口进入业务后台 1.微擎 2独立登陆页面 3.独立后台进入
$userData['role']=$_W['role'];//微擎账号登入角色founder总管理员
require __DIR__ . '/vendor/autoload.php';
session_start();
$userData['domain_url']=substr($_W['siteroot'],0,strlen($_W['siteroot'])-1);
$_SESSION['configData']=$configData;
$_SESSION['userInfo']=$userData;
//var_dump($_SESSION['userInfo']);die;
$uri = $_W['siteroot'] . 'addons/' . $_W['current_module']['name'] . $entry . '/channel/index/index?from=ws';
//var_dump($uri);die;
header('Location: ' . $uri);
die();
} else {
die('入口文件缺失,请联系商家!');
}
}
}