提交 86b01514 authored 作者: chengye's avatar chengye 提交者: wangkr

调整了部分文件缩进

上级 4e77c807
......@@ -5,20 +5,15 @@
* Date: 2020-3-22
* Time: 19:03
*/
namespace app\admin\controller;
use app\admin\model\StaffModel;
use think\Exception;
use think\facade\Cookie;
class SingleSign {
public $instence = null;
public function __construct(){
if($this->instence === null){
$redis = new \Redis();
$res = $redis->connect(config('admin.redis_host'),config('admin.redis_port'));
if($res) $this->instence = $redis;
......@@ -30,19 +25,14 @@ class SingleSign {
public function getSid($prex = 'PHPREDIS_SESSION:'){
$sid = Cookie::get('PHPSESSID');
$sid = $prex.$sid;
$str = $this->instence->get($sid);
if(!$str) throw new Exception("session info not found");
return $str;
}
//从session中读取信息
public function getUserInfo(){
$str = $this->getSid();
$pos = stripos($str,'is_admin|b:') + 11;
$isAdmin = substr($str,$pos,1);
$user['is_admin'] = $isAdmin;
......@@ -51,7 +41,6 @@ class SingleSign {
$user['username'] = 'gonnadmin';
} else {
preg_match('/adminuser\|s\:(\d+)\:/',$str,$match);
if($match){
$pos = stripos($str,'adminuser|s:') + strlen('adminuser|s:');
$pos += strlen($match[1]) + 2;
......@@ -59,14 +48,12 @@ class SingleSign {
}
}
$pos = stripos($str,'ukey|s:10:') + 11;
$ukey = substr($str,$pos,10);
$user['ukey'] = $ukey;
preg_match('/[\x80-\xff]+/',$str,$matchb);
if($matchb) $user['name'] = $matchb[0];
return $user;
}
......
......@@ -104,14 +104,12 @@
<span class="layui-bg-green">未审核</span>
{{# } }}
</script>
{if $admin == true}
<script type="text/html" id="barDemo">
{{# if(d.status == 1 || d.status == 3){ }}
<a title="编辑" class="layui-btn layui-btn-sm layui-bg-green" href="/useage_update/{{d.useage_id}}">编辑</a>
<a title="删除" class="layui-btn layui-btn-sm layui-btn-danger" lay-event="del">删除</a>
{{# } }}
</script>
{/if}
<script>
layui.use(['laydate','form','table'], function(){
var laydate = layui.laydate,
......
<?php
//配置文件
return [
//加密串
'passwd_salt' => 'gonn',
'passwd_init' => 'gonn',
'encrypt_key' => 'INJq4HXEGI',
'login_pattern' => '/^\w{2,}@\w+/', //开放模式
//'login_pattern' => '/^\w{2,}@gonn\.com\.cn$', 严格模式
'upload_dir' => './static/uploads',
'images_dir' => './static/uploads/images',
'files_dir' => './static/uploads/files',
'search_area' => '1', //1按部门搜索,2全局
'order_per' =>'ZD',
'redis_host' => '192.168.1.71',
'redis_port' => 6379,
];
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论