ComposerUpate&修改系统用户表

This commit is contained in:
Anyon 2019-12-26 17:38:04 +08:00
parent 8fcdfedffd
commit 7a40b79c83
18 changed files with 154 additions and 107 deletions

View File

@ -1,17 +1,17 @@
/*
Navicat Premium Data Transfer
Source Server : local.ctolog.com
Source Server : local.server.cuci.cc
Source Server Type : MySQL
Source Server Version : 50562
Source Host : 127.0.0.1:3306
Source Host : server.cuci.cc:3306
Source Schema : admin_v6
Target Server Type : MySQL
Target Server Version : 50562
File Encoding : 65001
Date: 16/12/2019 11:50:14
Date: 26/12/2019 17:34:44
*/
SET NAMES utf8mb4;
@ -62,33 +62,39 @@ CREATE TABLE `system_config` (
-- Records of system_config
-- ----------------------------
INSERT INTO `system_config` VALUES ('base', 'site_name', 'ThinkAdmin');
INSERT INTO `system_config` VALUES ('base', 'site_icon', 'http://static.ctolog.com//Fhx3kJQtSMjq26w96rAIb97tnGAO');
INSERT INTO `system_config` VALUES ('base', 'site_copy', '©版权所有 2014-2020 楚才科技');
INSERT INTO `system_config` VALUES ('base', 'site_icon', 'http://127.0.0.1:8000/upload/decb0fe26fa3f486/b3f6521bf29403c8.png');
INSERT INTO `system_config` VALUES ('base', 'site_copy', '©版权所有 2019-2020 楚才科技');
INSERT INTO `system_config` VALUES ('base', 'app_name', 'ThinkAdmin');
INSERT INTO `system_config` VALUES ('base', 'app_version', 'v6.0');
INSERT INTO `system_config` VALUES ('base', 'app_version', 'v1.0');
INSERT INTO `system_config` VALUES ('base', 'miitbeian', '粤ICP备16006642号-2');
INSERT INTO `system_config` VALUES ('storage', 'qiniu_http_protocol', 'http');
INSERT INTO `system_config` VALUES ('storage', 'type', 'local');
INSERT INTO `system_config` VALUES ('storage', 'allow_exts', 'doc,gif,icon,jpg,mp3,mp4,p12,pem,png,rar,xls,xlsx');
INSERT INTO `system_config` VALUES ('storage', 'qiniu_http_protocol', 'http');
INSERT INTO `system_config` VALUES ('storage', 'qiniu_region', '华东');
INSERT INTO `system_config` VALUES ('storage', 'qiniu_bucket', 'static');
INSERT INTO `system_config` VALUES ('storage', 'qiniu_http_domain', 'static.ctolog.com');
INSERT INTO `system_config` VALUES ('storage', 'qiniu_access_key', '');
INSERT INTO `system_config` VALUES ('storage', 'qiniu_secret_key', '');
INSERT INTO `system_config` VALUES ('wechat', 'token', 'mytoken');
INSERT INTO `system_config` VALUES ('wechat', 'appsecret', '');
INSERT INTO `system_config` VALUES ('wechat', 'encodingaeskey', '');
INSERT INTO `system_config` VALUES ('wechat', 'appid', '');
INSERT INTO `system_config` VALUES ('wechat', 'type', 'api');
INSERT INTO `system_config` VALUES ('wechat', 'appkey', '');
INSERT INTO `system_config` VALUES ('wechat', 'thr_appid', '');
INSERT INTO `system_config` VALUES ('wechat', 'thr_appkey', '');
INSERT INTO `system_config` VALUES ('wechat', 'mch_id', '');
INSERT INTO `system_config` VALUES ('wechat', 'mch_key', '');
INSERT INTO `system_config` VALUES ('storage', 'qiniu_access_key', 'OAFHGzCgZjod2-s4xr-g5ptkXsNbxDO_t2fozIEC');
INSERT INTO `system_config` VALUES ('storage', 'qiniu_secret_key', 'gy0aYdSFMSayQ4kMkgUeEeJRLThVjLpUJoPFxd-Z');
INSERT INTO `system_config` VALUES ('storage', 'alioss_http_protocol', 'http');
INSERT INTO `system_config` VALUES ('storage', 'alioss_point', 'oss-cn-hangzhou.aliyuncs.com');
INSERT INTO `system_config` VALUES ('storage', 'alioss_bucket', 'cuci-mytest');
INSERT INTO `system_config` VALUES ('storage', 'alioss_http_domain', 'cuci-mytest.oss-cn-hangzhou.aliyuncs.com');
INSERT INTO `system_config` VALUES ('storage', 'alioss_access_key', 'SLPvsVLjHljWo8iU');
INSERT INTO `system_config` VALUES ('storage', 'alioss_secret_key', 'NAPjuedlOpzBV54uTVWyc2AvlJw8cT');
INSERT INTO `system_config` VALUES ('wechat', 'token', '235612356123');
INSERT INTO `system_config` VALUES ('wechat', 'appsecret', '23561235612323561235612323561235');
INSERT INTO `system_config` VALUES ('wechat', 'encodingaeskey', '2356123561232356123561232356123561232356123');
INSERT INTO `system_config` VALUES ('wechat', 'appid', 'wx60a43dd8161666d4');
INSERT INTO `system_config` VALUES ('wechat', 'type', 'thr');
INSERT INTO `system_config` VALUES ('wechat', 'appkey', '7d0e4a487c6258b2232294b6ef0adb9e');
INSERT INTO `system_config` VALUES ('wechat', 'thr_appid', 'wx60a43dd8161666d4');
INSERT INTO `system_config` VALUES ('wechat', 'thr_appkey', '7d0e4a487c6258b2232294b6ef0adb9e');
INSERT INTO `system_config` VALUES ('wechat', 'mch_id', '1332187001');
INSERT INTO `system_config` VALUES ('wechat', 'mch_key', 'A82DC5BD1F3359081049C568D8502BC5');
INSERT INTO `system_config` VALUES ('wechat', 'mch_ssl_type', 'pem');
INSERT INTO `system_config` VALUES ('wechat', 'mch_ssl_p12', '');
INSERT INTO `system_config` VALUES ('wechat', 'mch_ssl_key', '');
INSERT INTO `system_config` VALUES ('wechat', 'mch_ssl_cer', '');
INSERT INTO `system_config` VALUES ('wechat', 'mch_ssl_p12', '551711cc69de42dc/01666bb5f928d8f7.p12');
INSERT INTO `system_config` VALUES ('wechat', 'mch_ssl_key', '50b015d91a867b2e/8fb4ada4bef5b009.pem');
INSERT INTO `system_config` VALUES ('wechat', 'mch_ssl_cer', '67c1e5d7a9490d8a/3f923af34e0421a5.pem');
-- ----------------------------
-- Table structure for system_data
@ -100,7 +106,7 @@ CREATE TABLE `system_data` (
`value` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '配置值',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_system_data_name`(`name`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统-数据';
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统-数据';
-- ----------------------------
-- Table structure for system_menu
@ -126,7 +132,6 @@ CREATE TABLE `system_menu` (
-- ----------------------------
-- Records of system_menu
-- ----------------------------
INSERT INTO `system_menu` VALUES (1, 0, '后台首页', '', '', 'admin/index/main', '', '_self', 500, 1, '2018-09-05 17:59:38');
INSERT INTO `system_menu` VALUES (2, 0, '系统管理', '', '', '#', '', '_self', 100, 1, '2018-09-05 18:04:52');
INSERT INTO `system_menu` VALUES (3, 4, '系统菜单管理', '', 'layui-icon layui-icon-layouts', 'admin/menu/index', '', '_self', 1, 1, '2018-09-05 18:05:26');
INSERT INTO `system_menu` VALUES (4, 2, '系统配置', '', '', '#', '', '_self', 20, 1, '2018-09-05 18:07:17');
@ -139,11 +144,11 @@ INSERT INTO `system_menu` VALUES (49, 4, '系统日志管理', '', 'layui-icon l
INSERT INTO `system_menu` VALUES (56, 0, '微信管理', '', '', '#', '', '_self', 200, 1, '2019-12-09 11:00:37');
INSERT INTO `system_menu` VALUES (57, 56, '微信管理', '', '', '#', '', '_self', 0, 1, '2019-12-09 13:56:58');
INSERT INTO `system_menu` VALUES (58, 57, '微信接口配置', '', 'layui-icon layui-icon-set', 'wechat/config/options', '', '_self', 0, 1, '2019-12-09 13:57:28');
INSERT INTO `system_menu` VALUES (59, 57, '微信支付配置', '', '', 'wechat/config/payment', '', '_self', 0, 1, '2019-12-09 13:58:42');
INSERT INTO `system_menu` VALUES (59, 57, '微信支付配置', '', 'layui-icon layui-icon-rmb', 'wechat/config/payment', '', '_self', 0, 1, '2019-12-09 13:58:42');
INSERT INTO `system_menu` VALUES (60, 56, '微信定制', '', '', '#', '', '_self', 0, 1, '2019-12-09 18:35:16');
INSERT INTO `system_menu` VALUES (61, 60, '微信粉丝管理', '', 'layui-icon layui-icon-username', 'wechat/fans/index', '', '_self', 0, 1, '2019-12-09 18:35:37');
INSERT INTO `system_menu` VALUES (62, 60, '微信图文管理', '', 'layui-icon layui-icon-template-1', 'wechat/news/index', '', '_self', 0, 1, '2019-12-09 18:43:51');
INSERT INTO `system_menu` VALUES (63, 60, '微信菜单配置', '', '', 'wechat/menu/index', '', '_self', 0, 1, '2019-12-09 22:49:28');
INSERT INTO `system_menu` VALUES (63, 60, '微信菜单配置', '', 'layui-icon layui-icon-cellphone', 'wechat/menu/index', '', '_self', 0, 1, '2019-12-09 22:49:28');
INSERT INTO `system_menu` VALUES (64, 60, '回复规则管理', '', 'layui-icon layui-icon-engine', 'wechat/keys/index', '', '_self', 0, 1, '2019-12-14 14:09:04');
INSERT INTO `system_menu` VALUES (65, 60, '关注回复配置', '', 'layui-icon layui-icon-senior', 'wechat/keys/subscribe', '', '_self', 0, 1, '2019-12-14 14:10:31');
INSERT INTO `system_menu` VALUES (66, 60, '默认回复配置', '', 'layui-icon layui-icon-util', 'wechat/keys/defaults', '', '_self', 0, 1, '2019-12-14 14:11:18');
@ -198,28 +203,31 @@ CREATE TABLE `system_user` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户账号',
`password` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户密码',
`qq` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '联系QQ',
`mail` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '联系邮箱',
`phone` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '联系手机',
`login_at` datetime NULL DEFAULT NULL COMMENT '登录时间',
`login_ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '登录地址',
`login_num` bigint(20) NULL DEFAULT 0 COMMENT '登录次数',
`nickname` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户昵称',
`headimg` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '头像地址',
`authorize` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '权限授权',
`tags` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户标签',
`desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '备注说明',
`contact_qq` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '联系QQ',
`contact_mail` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '联系邮箱',
`contact_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '联系手机',
`login_ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '登录地址',
`login_at` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '登录时间',
`login_num` bigint(20) NULL DEFAULT 0 COMMENT '登录次数',
`describe` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '备注说明',
`status` tinyint(1) NULL DEFAULT 1 COMMENT '状态(0禁用,1启用)',
`sort` bigint(20) NULL DEFAULT 0 COMMENT '排序权重',
`is_deleted` tinyint(1) NULL DEFAULT 0 COMMENT '删除(1删除,0未删)',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_system_user_username`(`username`) USING BTREE,
INDEX `idx_system_user_status`(`status`) USING BTREE,
INDEX `idx_system_user_username`(`username`) USING BTREE,
INDEX `idx_system_user_deleted`(`is_deleted`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 10001 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统-用户';
-- ----------------------------
-- Records of system_user
-- ----------------------------
INSERT INTO `system_user` VALUES (10000, 'admin', '21232f297a57a5a743894a0e4a801fc3', '22222222', '', '', '2019-12-16 11:28:13', '221.217.23.91', 1051, '', '', '', 1, 0, '2015-11-13 15:14:22');
INSERT INTO `system_user` VALUES (10000, 'admin', '21232f297a57a5a743894a0e4a801fc3', '系统管理员', 'http://127.0.0.1:1111/upload/decb0fe26fa3f486/b3f6521bf29403c8.png', '', '22222222', '', '', '127.0.0.1', '2019-12-26 15:45:50', 1043, '', 1, 0, 0, '2015-11-13 15:14:22');
-- ----------------------------
-- Table structure for wechat_fans
-- ----------------------------

View File

@ -43,7 +43,7 @@ class User extends Controller
{
$this->title = '系统用户管理';
$query = $this->_query($this->table)->like('username,phone,mail')->equal('status');
$query->dateBetween('login_at,create_at')->where(['is_deleted' => '0'])->order('id desc')->page();
$query->dateBetween('login_at,create_at')->where(['is_deleted' => '0'])->order('sort desc,id desc')->page();
}
/**

View File

@ -1,38 +1,48 @@
<form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">
<div class="layui-card-body padding-left-40">
<div class="layui-form-item">
<label class="relative block">
<span class="color-green font-w7">登录用户账号</span>
<div class="layui-col-xs2">
<input type="hidden" name="headimg" value="{$vo.headimg|default=''}">
<script>$('[name=headimg]').uploadOneImage()</script>
</div>
<label class="layui-col-xs10 relative block">
<span class="color-green font-w7 font-s14">登录账号</span>
<span class="color-desc margin-left-5">Username</span>
{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">
{/if}
<span class="help-block">登录账号不能出现重复,注意账号创建后不允许再次修改</span>
</label>
<p class="help-block">登录用户账号创建后,不允许再次修改。</p>
</div>
<div class="layui-form-item">
<label class="relative block">
<span class="color-green font-w7">用户联系手机</span>
<span class="color-desc margin-left-5">Phone</span>
<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">
</label>
<p class="color-desc">可选,用户联系手机号码,需要填写正确的格式</p>
</div>
<div class="layui-form-item">
<label class="relative block">
<span class="color-green font-w7">联系电子邮箱</span>
<span class="color-desc margin-left-5">Email</span>
<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">
</label>
<p class="color-desc">可选,用户联系电子邮箱,需要填写正确的格式</p>
</div>
<label class="layui-form-item relative block">
<span class="color-green font-w7 font-s14">用户昵称</span>
<span class="color-desc margin-left-5">Nickname</span>
<input name="nickname" value='{$vo.nickname|default=""}' placeholder="请输入用户的昵称" class="layui-input">
<span class="help-block">可选,用于显示账号名称,请尽量保持不要重复</span>
</label>
<label class="layui-form-item relative block">
<span class="color-green font-w7 font-s14">联系手机</span>
<span class="color-desc margin-left-5">Phone</span>
<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">
<span class="color-desc">可选,用户联系手机号码,需要填写正确的格式</span>
</label>
<label class="layui-form-item relative block">
<span class="color-green font-w7 font-s14">联系邮箱</span>
<span class="color-desc margin-left-5">Email</span>
<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">
<span class="color-desc">可选,用户联系电子邮箱,需要填写正确的格式</span>
</label>
{notempty name='authorizes'}
<div class="layui-form-item relative">
<span class="color-green font-w7">角色访问授权</span>
<span class="color-green font-w7 font-s14">访问授权</span>
<span class="color-desc margin-left-5">Authorization</span>
<div class="layui-textarea">
{if isset($vo.username) and $vo.username eq 'admin'}
@ -54,13 +64,12 @@
</div>
{/notempty}
<div class="layui-form-item">
<label class="relative block">
<span class="color-green font-w7">用户身份描述</span>
<span class="color-desc margin-left-5">Description</span>
<textarea placeholder="请输入用户身份描述" class="layui-textarea" name="desc">{$vo.desc|default=""}</textarea>
</label>
</div>
<label class="layui-form-item relative block">
<span class="color-green font-w7 font-s14">用户描述</span>
<span class="color-desc margin-left-5">Description</span>
<textarea placeholder="请输入用户描述" class="layui-textarea" name="desc">{$vo.desc|default=""}</textarea>
</label>
</div>
<div class="hr-line-dashed"></div>

View File

@ -22,13 +22,14 @@
<th class='list-table-check-td think-checkbox'>
<label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
</th>
<th class='text-left nowrap'>用户账号</th>
<th class='text-left nowrap'>联系手机</th>
<th class='text-center nowrap'>登录次数</th>
<th class='text-center nowrap'>使用状态</th>
<th class='text-left nowrap'>创建时间</th>
<th class='text-left nowrap'>登录时间</th>
<th class='text-left nowrap'></th>
<th class='list-table-sort-td'>
<button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
</th>
<th class='text-left nowrap'>用户信息</th>
<th class='text-left nowrap layui-hide-xs'>联系方式</th>
<th class='text-left nowrap layui-hide-xs'>最近登录</th>
<th class='text-left nowrap'>账号状态</th>
<th></th>
</tr>
</thead>
{/notempty}
@ -38,26 +39,43 @@
<td class='list-table-check-td think-checkbox'>
<label><input class="list-check-box" value='{$vo.id}' type='checkbox'></label>
</td>
<td class='text-left nowrap'>{$vo.username|default=''}</td>
<td class='text-left nowrap'>{$vo.phone|default='-'}</td>
<td class='text-center nowrap'>{$vo.login_num|default=0}</td>
<td class='text-center nowrap'>{eq name='vo.status' value='0'}<span class="color-red">已禁用</span>{else}<span class="color-green">使用中</span>{/eq}</td>
<td class='text-left nowrap'>{$vo.create_at|format_datetime}</td>
<td class='text-left nowrap'>{if $vo.login_num>0}{$vo.login_at|format_datetime}{else} - {/if}</td>
<td class='list-table-sort-td'>
<label><input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort}" class="list-sort-input"></label>
</td>
<td class='text-left nowrap'>
<img alt="img" width="40px" height="40px" class="text-top margin-right-10" data-tips-image src="{$vo.headimg|default=''}">
<div class="inline-block">
登录账号:{$vo.username|default=''}<br>
账号昵称:{$vo.nickname|default='<span class="color-desc">未配置账号昵称</span>'|raw}<br>
</div>
</td>
<td class='text-left nowrap layui-hide-xs'>
联系邮箱:{$vo.contact_mail|default='<span class="color-desc">未配置联系邮箱</span>'|raw}<br>
联系手机:{$vo.contact_phone|default='<span class="color-desc">未配置联系手机</span>'|raw}<br>
</td>
<td class='text-left nowrap layui-hide-xs'>
登录次数:{$vo.login_num|default=0}<br>
登录地址:{$vo.login_ip|default='--'}<br>
</td>
<td class='text-left nowrap'>
账号状态:{eq name='vo.status' value='0'}<span class="color-red">已禁用</span>{else}<span class="color-green">使用中</span>{/eq}<br>
创建时间:{$vo.create_at|format_datetime}
</td>
<td class='text-left nowrap'>
{if auth("pass")}
<a class="layui-btn layui-btn-normal layui-btn-sm" data-title="设置密码" data-modal='{:url("pass")}?id={$vo.id}'>密 码</a>
<a class="layui-btn layui-btn-sm layui-btn-normal" data-title="设置密码" data-modal='{:url("pass")}?id={$vo.id}'>密 码</a>
{/if}
{if auth("edit")}
<a data-dbclick class="layui-btn layui-btn-sm" data-title="编辑用户" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
<a data-dbclick class="layui-btn layui-btn-sm" data-title="编辑用户资料" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
{/if}
{if $vo.status eq 1 and auth("state")}
{if auth("state") and $vo.status eq 1}
<a class="layui-btn layui-btn-sm layui-btn-warm" data-confirm="确定要禁用该用户吗?" data-action="{:url('state')}" data-value="id#{$vo.id};status#0" data-csrf="{:systoken('state')}">禁 用</a>
{/if}
{if $vo.status eq 0 and auth("state")}
{if auth("state") and $vo.status eq 0}
<a class="layui-btn layui-btn-sm layui-btn-warm" data-confirm="确定要启用该用户吗?" data-action="{:url('state')}" data-value="id#{$vo.id};status#1" data-csrf="{:systoken('state')}">启 用</a>
{/if}

View File

@ -20,7 +20,7 @@
<thead>
<tr>
<th class='list-table-check-td think-checkbox'>
<input data-auto-none data-check-target='.list-check-box' type='checkbox'/>
<label><input data-auto-none data-check-target='.list-check-box' type='checkbox'/></label>
</th>
<th class='list-table-sort-td'>
<button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
@ -38,10 +38,10 @@
{foreach $list as $key=>$vo}
<tr>
<td class='list-table-check-td think-checkbox'>
<input class="list-check-box" value='{$vo.id}' type='checkbox'/>
<label><input class="list-check-box" value='{$vo.id}' type='checkbox'/></label>
</td>
<td class='list-table-sort-td'>
<input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort}" class="list-sort-input">
<label><input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort}" class="list-sort-input"></label>
</td>
<td class="text-left nowrap">
{notempty name='vo.qrc'}<i class="fa fa-qrcode fa-lg pointer margin-right-5" data-load="{$vo.qrc}" data-time="false" data-tips-text="生成关键字二维码"></i>{/notempty}

8
composer.lock generated
View File

@ -909,12 +909,12 @@
"source": {
"type": "git",
"url": "https://github.com/zoujingli/ThinkLibrary.git",
"reference": "d9b6c53ed98ef92d9d9560c38e7d9442350042f5"
"reference": "905a9a503897919ded0a61b84c5af6ac763fc736"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/d9b6c53ed98ef92d9d9560c38e7d9442350042f5",
"reference": "d9b6c53ed98ef92d9d9560c38e7d9442350042f5",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/905a9a503897919ded0a61b84c5af6ac763fc736",
"reference": "905a9a503897919ded0a61b84c5af6ac763fc736",
"shasum": "",
"mirrors": [
{
@ -958,7 +958,7 @@
],
"description": "ThinkPHP v6.0 Development Library",
"homepage": "http://framework.thinkadmin.top",
"time": "2019-12-25T02:08:57+00:00"
"time": "2019-12-25T09:17:55+00:00"
},
{
"name": "zoujingli/wechat-developer",

View File

@ -200,7 +200,7 @@ label.think-radio {
box-shadow: none;
}
.layui-layer-content .layui-form.layui-card .layui-card-body {
padding: 20px 40px 0 0;
padding: 30px 40px 0 0;
}
.layui-layer-dialog .layui-layer-content .layui-layer-ico {
top: 50% !important;
@ -1140,7 +1140,8 @@ label.think-radio {
height: 5pc;
cursor: pointer;
display: inline-block;
background: url('../img/image.png') no-repeat center center;
border: 1px dashed #e2e2e2;
background: url('../img/upimg.png') no-repeat center center;
background-size: cover;
}
.uploadimagemtl {

File diff suppressed because one or more lines are too long

View File

@ -463,7 +463,7 @@
height: 5pc;
cursor: pointer;
display: inline-block;
background: url('../img/image.png') no-repeat center center;
background: url('../img/upimg.png') no-repeat center center;
background-size: cover;
}
.uploadimagemtl {

View File

@ -1 +0,0 @@
{"version":3,"sources":["console.custom.less"],"names":[],"mappings":"AAAA;EACE,aAAA;EACA,cAAA;EACA,eAAA;EACA,kBAAA;EACA,iBAAA;EACA,mBAAA;EACA,yBAAA;EACA,yBAAA;EACA,0BAAA;;AAGF;EACE,iBAAA;EACA,qBAAA;EACA,sBAAA;EACA,yBAAA;;AAGF;EACE,2BAAA;EACA,8BAAA;EACA,gCAAA;EACA,mCAAA;;AAGF;EACE,kBAAA;;AAGF;EACE,kBAAA;;AAGF;EACE,cAAA;;AAGF;EACE,eAAA;;AAGF;EACE,mBAAA;;AAGF;EACE,WAAA;EACA,eAAA;;AAGF;EACE,qBAAA;;AAKA,MAAC;EACC,WAAA;;AAGF,MAAC;EACC,YAAA;;AAKF,MAAC;EACC,WAAA;;AAGF,MAAC;EACC,YAAA;;AAKF,OAAC;EACC,cAAA;;AAGF,OAAC;EACC,cAAA;;AAGF,OAAC;EACC,WAAA;;AAGF,OAAC;EACC,WAAA;;AAGF,OAAC;EACC,WAAA;;AAKF,MAAC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B;EACA,sBAAA;;AAGF;EACE,iBAAA;;AADF,eAGE;EACE,WAAA;EACA,WAAA;EACA,YAAA;EACA,YAAA;EACA,aAAA;EACA,kBAAA;EACA,iBAAA;EACA,8BAAA;;AAGF,eAAC,MAAO;EACN,eAAA;EACA,qBAAA;;AAEA,eAJD,MAAO,EAIL;EACC,WAAA;EACA,qBAAA;;;AAMN;EACE,iBAAA;;AADF,qBAGE;EACE,WAAA;EACA,cAAA;;AALJ,qBAQE;EACE,YAAA;EACA,qBAAA;EACA,SAAA;EACA,UAAA;;AAZJ,qBAQE,KAME;EACE,UAAA;EACA,qBAAA;;AAEA,qBAVJ,KAME,KAIG;EACC,UAAA;;AADF,qBAVJ,KAME,KAIG,OAGC;EACE,WAAA;EACA,kBAAA;EACA,kBAAA;EACA,mBAAA;;AAzBV,qBAQE,KAME,KAeE;AA7BN,qBAQE,KAME,KAeO;EACH,WAAA;EACA,WAAA;EACA,YAAA;EACA,yBAAA;EACA,qBAAA;EACA,iBAAA;EACA,kBAAA;EACA,iBAAA;;AArCR,qBAQE,KAME,KA0BE;EACE,mBAAA;EACA,eAAA;;AA1CR,qBAQE,KAME,KA+BE,IAAG;EACD,mBAAA;EACA,qBAAA;;AAMR;EACE,eAAA;;AAGF;EACE,eAAA;EACA,mBAAA;;AAFF,uBAIE;EACE,QAAA;EACA,SAAA;EACA,eAAA;EACA,kBAAA;EACA,+BAAA;;AATJ,uBAYE;EACE,WAAA;EACA,gBAAA;EACA,kBAAA;EACA,kBAAA;;AAhBJ,uBAYE,mBAME,MAAK,UAAU;EACb,eAAA;EACA,iBAAA","file":"console.custom.css"}

View File

@ -639,7 +639,8 @@
height: 5pc;
cursor: pointer;
display: inline-block;
background: url('../img/image.png') no-repeat center center;
border: 1px dashed #e2e2e2;
background: url('../img/upimg.png') no-repeat center center;
background-size: cover;
}

View File

@ -3,7 +3,7 @@
}
.layui-layer-content .layui-form.layui-card .layui-card-body {
padding: 20px 40px 0 0
padding: 30px 40px 0 0
}
.layui-layer-dialog .layui-layer-content .layui-layer-ico {

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@ -935,12 +935,12 @@
"source": {
"type": "git",
"url": "https://github.com/zoujingli/ThinkLibrary.git",
"reference": "d9b6c53ed98ef92d9d9560c38e7d9442350042f5"
"reference": "905a9a503897919ded0a61b84c5af6ac763fc736"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/d9b6c53ed98ef92d9d9560c38e7d9442350042f5",
"reference": "d9b6c53ed98ef92d9d9560c38e7d9442350042f5",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/905a9a503897919ded0a61b84c5af6ac763fc736",
"reference": "905a9a503897919ded0a61b84c5af6ac763fc736",
"shasum": "",
"mirrors": [
{
@ -956,7 +956,7 @@
"ext-json": "*",
"topthink/framework": "^6.0"
},
"time": "2019-12-25T02:08:57+00:00",
"time": "2019-12-25T09:17:55+00:00",
"type": "library",
"extra": {
"think": {

2
vendor/services.php vendored
View File

@ -1,5 +1,5 @@
<?php
// This file is automatically generated at:2019-12-25 11:04:15
// This file is automatically generated at:2019-12-26 17:37:46
declare (strict_types = 1);
return array (
0 => 'think\\app\\Service',

View File

@ -87,11 +87,12 @@ abstract class Controller extends \stdClass
/**
* 返回失败的操作
* @param mixed $info 消息内容
* @param array $data 返回数据
* @param mixed $data 返回数据
* @param integer $code 返回代码
*/
public function error($info, $data = [], $code = 0)
public function error($info, $data = '{-null-}', $code = 0)
{
if ($data === '{-null-}') $data = new \stdClass();
throw new HttpResponseException(json([
'code' => $code, 'info' => $info, 'data' => $data,
]));
@ -100,14 +101,15 @@ abstract class Controller extends \stdClass
/**
* 返回成功的操作
* @param mixed $info 消息内容
* @param array $data 返回数据
* @param mixed $data 返回数据
* @param integer $code 返回代码
*/
public function success($info, $data = [], $code = 1)
public function success($info, $data = '{-null-}', $code = 1)
{
if ($this->csrf_state) {
TokenHelper::instance()->clear();
}
if ($data === '{-null-}') $data = new \stdClass();
throw new HttpResponseException(json([
'code' => $code, 'info' => $info, 'data' => $data,
]));

View File

@ -84,10 +84,10 @@ class PageHelper extends Helper
$limit = $this->app->request->get('limit', $this->app->cookie->get('limit'));
$this->app->cookie->set('limit', $limit = intval($limit >= 10 ? $limit : 20));
}
list($options, $query) = ['', $this->app->request->get()];
[$options, $query] = ['', $this->app->request->get()];
$pager = $this->query->paginate(['list_rows' => $limit, 'query' => $query], $this->total);
foreach ([10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200] as $num) {
list($query['limit'], $query['page'], $selected) = [$num, 1, $limit === $num ? 'selected' : ''];
[$query['limit'], $query['page'], $selected] = [$num, 1, $limit === $num ? 'selected' : ''];
if (stripos($this->app->request->get('spm', '-'), 'm-') === 0) {
$url = url('@admin') . '#' . $this->app->request->baseUrl() . '?' . urldecode(http_build_query($query));
} else {
@ -124,7 +124,7 @@ class PageHelper extends Helper
$pk = $this->query->getPk() ?? 'id';
if ($this->app->request->has($pk, 'post')) {
$map = [$pk => $this->app->request->post($pk, 0)];
$data = ['sort' => intval(isset($map['sort']) ?? 0)];
$data = ['sort' => intval($this->app->request->post('sort', 0))];
if ($this->app->db->table($this->query->getTable())->where($map)->update($data) !== false) {
$this->controller->success('列表排序修改成功!', '');
}

View File

@ -35,6 +35,15 @@ class AdminService extends Service
return $this->app->session->get('user.id') ? true : false;
}
/**
* 获取后台用户ID
* @return integer
*/
public function getUserId()
{
return $this->app->session->get('user.id') ?? 0;
}
/**
* 检查指定节点授权
* --- 需要读取缓存或扫描所有节点