mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
[更新]同步来自Framework代码
This commit is contained in:
parent
21f8fdd880
commit
d20dd126bb
@ -31,7 +31,6 @@ class Config extends Controller
|
||||
|
||||
/**
|
||||
* 系统参数配置
|
||||
* @return mixed
|
||||
* @throws \think\Exception
|
||||
* @throws \think\exception\PDOException
|
||||
*/
|
||||
@ -49,7 +48,6 @@ class Config extends Controller
|
||||
|
||||
/**
|
||||
* 文件存储配置
|
||||
* @return string
|
||||
* @throws \think\Exception
|
||||
* @throws \think\exception\PDOException
|
||||
*/
|
||||
|
@ -16,7 +16,6 @@ namespace app\admin\controller;
|
||||
|
||||
use library\Controller;
|
||||
use think\Db;
|
||||
use think\Session;
|
||||
|
||||
/**
|
||||
* 用户登录管理
|
||||
|
@ -45,7 +45,8 @@ class User extends Controller
|
||||
public function index()
|
||||
{
|
||||
$this->title = '系统用户管理';
|
||||
$this->_query($this->table)->where(['is_deleted' => '0'])->like('username,phone,mail')->dateBetween('login_at')->equal('status')->page();
|
||||
$where = ['is_deleted' => '0'];
|
||||
$this->_query($this->table)->like('username,phone,mail')->dateBetween('login_at')->equal('status')->where($where)->page();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -200,18 +200,4 @@ class Plugs extends Controller
|
||||
$this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统消息展示
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function message()
|
||||
{
|
||||
$this->title = '系统消息';
|
||||
$this->list = Db::name('SystemMessage')->where(['read_state' => '0'])->order('id desc')->select();
|
||||
$this->fetch();
|
||||
}
|
||||
|
||||
}
|
@ -1,65 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>{block name="title"}{$title|default=''}{if !empty($title)} · {/if}{:sysconf('site_name')}{/block}</title>
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta name="format-detection" content="telephone=no">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
|
||||
<link href="__ROOT__/static/plugs/layui/css/layui.css?v={:date('ymd')}" rel="stylesheet">
|
||||
<style>.layui-card {
|
||||
margin: 0
|
||||
}
|
||||
|
||||
.layui-card .layui-card-body a {
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
color: #666
|
||||
}</style>
|
||||
<script src="__ROOT__/static/plugs/angular/angular.min.js"></script>
|
||||
</head>
|
||||
<body id="MessageContainer">
|
||||
<div class="layui-card" ng-repeat="x in list">
|
||||
<div class="layui-card-header layui-bg-gray">
|
||||
<a target="_top" href="{:url('@admin')}?messagecode={{x.code}}#{{x.url}}" ng-bind="x.title"></a>
|
||||
<a href="javascript:void(0)" ng-click="setReadState(x.code)" style="position:absolute;right:0;top:0;width:50px;text-align:center">忽略</a>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<a target="_top" href="{:url('@admin')}?messagecode={{x.code}}#{{x.url}}" ng-bind="x.desc"></a>
|
||||
<a target="_top" href="{:url('@admin')}?messagecode={{x.code}}#{{x.url}}" ng-bind="x.create_at"></a>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
(function () {
|
||||
var index = parent.layer.getFrameIndex(window.name);
|
||||
var app = angular.module("MessageContainer", []).run(callback);
|
||||
angular.bootstrap(document.getElementById(app.name), [app.name]);
|
||||
|
||||
function callback($rootScope, $http, $timeout, $interval) {
|
||||
$rootScope.list = [];
|
||||
$rootScope.setReadState = function (code) {
|
||||
$http.post('{:url("@admin/api.message/set")}', {code: code}).then(function () {
|
||||
refresh(false);
|
||||
});
|
||||
};
|
||||
refresh.call(this, true), $interval(function () {
|
||||
parent.layer.iframeAuto(index);
|
||||
// top.$body.trigger('resize');
|
||||
}, 10);
|
||||
|
||||
function refresh(isCallback) {
|
||||
$http.get('{:url("@admin/api.message/gets")}').then(function (ret) {
|
||||
$rootScope.list = (ret.data || {data: []}).data;
|
||||
if ($rootScope.list < 1) parent.layer.style(index, {height: '0'});
|
||||
if (isCallback !== false) $timeout(refresh, 2000);
|
||||
});
|
||||
}
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -15,9 +15,7 @@
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="layui-form-item text-center">
|
||||
<!--{notempty name='vo.id'}-->
|
||||
<input type='hidden' value='{$vo.id}' name='id'>
|
||||
<!--{/notempty}-->
|
||||
{notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
|
||||
<button class="layui-btn" type='submit'>保存数据</button>
|
||||
<button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗?" data-close>取消编辑</button>
|
||||
</div>
|
||||
|
@ -64,9 +64,7 @@
|
||||
<div class="hr-line-dashed"></div>
|
||||
|
||||
<div class="layui-form-item text-center">
|
||||
<!--{notempty name='vo.id'}-->
|
||||
<input type='hidden' value='{$vo.id}' name='id'>
|
||||
<!--{/notempty}-->
|
||||
{notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
|
||||
<button class="layui-btn" type='submit'>保存数据</button>
|
||||
<button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗?" data-close>取消编辑</button>
|
||||
</div>
|
||||
|
@ -4,11 +4,11 @@
|
||||
|
||||
{if auth("admin/message/onoff")}
|
||||
<form class="layui-form inline-block StatusSwitch" action="">
|
||||
<!--{if sysconf('system_message_state')}-->
|
||||
<input type="checkbox" checked lay-skin="switch" lay-filter="StatusSwitch" lay-text="开启|关闭">
|
||||
<!--{else}-->
|
||||
<input type="checkbox" lay-skin="switch" lay-filter="StatusSwitch" lay-text="开启|关闭">
|
||||
<!--{/if}-->
|
||||
{if sysconf('system_message_state')}
|
||||
<input type="checkbox" checked lay-skin="switch" lay-filter="StatusSwitch" lay-text="开 启|关 闭">
|
||||
{else}
|
||||
<input type="checkbox" lay-skin="switch" lay-filter="StatusSwitch" lay-text="开 启|关 闭">
|
||||
{/if}
|
||||
<script>
|
||||
form.on('switch(StatusSwitch)', function () {
|
||||
$.form.load('{:url("onoff")}', {}, 'get', function () {
|
||||
@ -18,8 +18,15 @@
|
||||
</script>
|
||||
<style>
|
||||
form.StatusSwitch .layui-form-switch {
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
border-radius: 2px;
|
||||
margin: 0 10px 0 0;
|
||||
}
|
||||
|
||||
form.StatusSwitch .layui-form-switch i {
|
||||
top: 6px;
|
||||
}
|
||||
</style>
|
||||
</form>
|
||||
{/if}
|
||||
|
@ -1,9 +1,9 @@
|
||||
{extend name='main'}
|
||||
|
||||
{block name='button'}
|
||||
<!--{if auth("admin/node/clear")}-->
|
||||
{if auth("admin/node/clear")}
|
||||
<button data-load='{:url("clear")}' class='layui-btn layui-btn-sm layui-btn-primary'>清理无效记录</button>
|
||||
<!--{/if}-->
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
{block name='style'}
|
||||
|
@ -13,24 +13,26 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">访问授权</label>
|
||||
<div class="layui-input-block">
|
||||
{if isset($vo.username) and $vo.username eq 'admin'}
|
||||
<span class="color-desc" style="line-height:36px">超级用户不需要配置权限</span>
|
||||
{else}
|
||||
{foreach $authorizes as $authorize}
|
||||
<label class="think-checkbox">
|
||||
<!--{if in_array($authorize['id'],$vo['authorize'])}-->
|
||||
{if in_array($authorize.id, $vo.authorize)}
|
||||
<input type="checkbox" checked name="authorize[]" value="{$authorize.id}" lay-ignore> {$authorize.title}
|
||||
<!--{else}-->
|
||||
{else}
|
||||
<input type="checkbox" name="authorize[]" value="{$authorize.id}" lay-ignore> {$authorize.title}
|
||||
<!--{/if}-->
|
||||
{/if}
|
||||
</label>
|
||||
{/foreach}
|
||||
{if empty($authorizes)}<span class="color-desc" style="line-height:36px">未配置权限</span>{/if}
|
||||
{empty name='authorizes'}<span class="color-desc" style="line-height:36px">未配置权限</span>{/empty}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="layui-form-item text-center">
|
||||
<!--{notempty name='vo.id'}-->
|
||||
<input type='hidden' value='{$vo.id}' name='id'>
|
||||
<!--{/notempty}-->
|
||||
{notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
|
||||
<button class="layui-btn" type='submit'>保存数据</button>
|
||||
<button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗?" data-close>取消编辑</button>
|
||||
</div>
|
||||
|
@ -3,7 +3,7 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label label-required">用户账号</label>
|
||||
<div class="layui-input-block">
|
||||
<!--{if $vo and isset($vo.username)}-->
|
||||
<!--{if isset($vo) and isset($vo.username)}-->
|
||||
<input disabled value='{$vo.username|default=""}' class="layui-input layui-bg-gray">
|
||||
<!--{else}-->
|
||||
<input name="username" value='{$vo.username|default=""}' required pattern="^.{4,}$" placeholder="请输入4位及以上字符用户名称" class="layui-input">
|
||||
@ -13,32 +13,36 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">联系手机</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="tel" maxlength="11" autofocus name="phone" value='{$vo.phone|default=""}' pattern="^1[3-9][0-9]{9}$" placeholder="请输入联系手机" class="layui-input">
|
||||
<input type="tel" maxlength="11" autocomplete="off" autofocus name="phone" value='{$vo.phone|default=""}' pattern="^1[3-9][0-9]{9}$" placeholder="请输入联系手机" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">联系邮箱</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="mail" pattern="^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$" value='{$vo.mail|default=""}' placeholder="请输入联系邮箱" class="layui-input">
|
||||
<input name="mail" autocomplete="off" pattern="^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$" value='{$vo.mail|default=""}' placeholder="请输入联系邮箱" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<!--{if isset($authorizes)}-->
|
||||
{notempty name='authorizes'}
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">访问授权</label>
|
||||
<div class="layui-input-block">
|
||||
{if isset($vo.username) and $vo.username eq 'admin'}
|
||||
<span class="color-desc" style="line-height:36px">超级用户不需要配置权限</span>
|
||||
{else}
|
||||
{foreach $authorizes as $authorize}
|
||||
<label class="think-checkbox">
|
||||
<!--{if in_array($authorize['id'],$vo['authorize'])}-->
|
||||
{if in_array($authorize.id, $vo.authorize)}
|
||||
<input type="checkbox" checked name="authorize[]" value="{$authorize.id}" lay-ignore> {$authorize.title}
|
||||
<!--{else}-->
|
||||
{else}
|
||||
<input type="checkbox" name="authorize[]" value="{$authorize.id}" lay-ignore> {$authorize.title}
|
||||
<!--{/if}-->
|
||||
{/if}
|
||||
</label>
|
||||
{/foreach}
|
||||
{if empty($authorizes)}<span class="color-desc" style="line-height:36px">未配置权限</span>{/if}
|
||||
{empty name='authorizes'}<span class="color-desc" style="line-height:36px">未配置权限</span>{/empty}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<!--{/if}-->
|
||||
{/notempty}
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">用户描述</label>
|
||||
<div class="layui-input-block">
|
||||
@ -48,9 +52,7 @@
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="layui-form-item text-center">
|
||||
<!--{notempty name='vo.id'}-->
|
||||
<input type='hidden' value='{$vo.id}' name='id'>
|
||||
<!--{/notempty}-->
|
||||
{notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
|
||||
<button class="layui-btn" type='submit'>保存数据</button>
|
||||
<button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗?" data-close>取消编辑</button>
|
||||
</div>
|
||||
|
@ -45,9 +45,7 @@
|
||||
<div class="hr-line-dashed"></div>
|
||||
|
||||
<div class="layui-form-item text-center">
|
||||
<!--{notempty name='vo.id'}-->
|
||||
<input type='hidden' value='{$vo.id}' name='id'>
|
||||
<!--{/notempty}-->
|
||||
{notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
|
||||
<button class="layui-btn" type='submit'>保存数据</button>
|
||||
<button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗?" data-close>取消编辑</button>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user