You've already forked qlg.tsgz.moe
addons
app_download_files
extend
hyhproject
admin
behavior
common
function.php
conf
controller
model
validate
view
app
common
home
home2
mobile2
wechat2
.htaccess
command.php
mobile
oss
static
thinkphp
upload
vendor
wxtmp
.gitignore
.htaccess
.user.ini
404.html
H5436787D.wgt
admin.php
app-release.apk
app_download.html
cash.lock
demo.php
get_version.php
get_version_new.php
index.html
index.php
reg.lock
robots.txt
59 lines
1.8 KiB
PHP
Executable File
59 lines
1.8 KiB
PHP
Executable File
<?php
|
|
use think\Db;
|
|
/**
|
|
* ============================================================================
|
|
*/
|
|
/**
|
|
* 加载系统访问路径
|
|
*/
|
|
function WSTVisitPrivilege(){
|
|
$listenUrl = cache('WST_LISTEN_URL');
|
|
if(!$listenUrl){
|
|
$list = model('admin/Privileges')->getAllPrivileges();
|
|
$listenUrl = [];
|
|
foreach ($list as $v){
|
|
if($v['privilegeUrl']=='')continue;
|
|
$listenUrl[strtolower($v['privilegeUrl'])][$v['privilegeCode']] = ['code'=>$v['privilegeCode'],
|
|
'url'=>strtolower($v['privilegeUrl']),
|
|
'name'=>$v['privilegeName'],
|
|
'isParent'=>true,
|
|
'menuId'=>$v['menuId']
|
|
];
|
|
if(strpos($v['otherPrivilegeUrl'],'/')!==false){
|
|
$t = explode(',',$v['otherPrivilegeUrl']);
|
|
foreach ($t as $vv){
|
|
if(strpos($vv,'/')!==false){
|
|
$listenUrl[strtolower($vv)][$v['privilegeCode']] = ['code'=>$v['privilegeCode'],
|
|
'url'=>strtolower($vv),
|
|
'name'=>$v['privilegeName'],
|
|
'isParent'=>false,
|
|
'menuId'=>$v['menuId']
|
|
];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
cache('WST_LISTEN_URL',$listenUrl);
|
|
}
|
|
return $listenUrl;
|
|
}
|
|
|
|
/**
|
|
* 判断有没有权限
|
|
* @param $code 权限代码
|
|
* @param $type 返回的类型 true-boolean false-string
|
|
*/
|
|
function WSTGrant($code){
|
|
$STAFF = session("WST_STAFF");
|
|
if(in_array($code,$STAFF['privileges']))return true;
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
* 微信配置
|
|
*/
|
|
function WXAdmin(){
|
|
$wechat = new \wechat\WSTWechat(WSTConf('CONF.wxAppId'),WSTConf('CONF.wxAppKey'));
|
|
return $wechat;
|
|
}
|