[更新]修正文件上传后缀检查,同步更新后台UI

This commit is contained in:
Anyon 2017-09-27 16:22:16 +08:00
parent ac1d208534
commit 58bdcbbab5
17 changed files with 429 additions and 266 deletions

View File

@ -14,7 +14,9 @@
namespace app\admin\controller; namespace app\admin\controller;
use app\store\OrderService;
use controller\BasicAdmin; use controller\BasicAdmin;
use service\ExtendService;
use service\LogService; use service\LogService;
/** /**
@ -50,8 +52,8 @@ class Config extends BasicAdmin
foreach ($this->request->post() as $key => $vo) { foreach ($this->request->post() as $key => $vo) {
sysconf($key, $vo); sysconf($key, $vo);
} }
LogService::write('系统管理', '修改系统配置参数成功'); LogService::write('系统管理', '系统参数配置成功');
$this->success('数据修改成功!', ''); $this->success('系统参数配置成功!', '');
} }
/** /**
@ -60,9 +62,22 @@ class Config extends BasicAdmin
public function file() public function file()
{ {
$this->title = '文件存储配置'; $this->title = '文件存储配置';
$alert = ['type' => 'success', 'title' => '操作提示', 'content' => '文件引擎参数影响全局文件上传功能,请勿随意修改!']; $alert = [
'type' => 'success', 'title' => '操作提示',
'content' => '文件引擎参数影响全局文件上传功能,请勿随意修改!'
];
$this->assign('alert', $alert); $this->assign('alert', $alert);
return $this->index(); return $this->index();
} }
/**
* 短信参数配置
*/
public function sms()
{
$this->title = '短信服务配置';
$this->assign('result', ExtendService::querySmsBalance());
return $this->index();
}
} }

View File

@ -39,43 +39,36 @@ class Index extends BasicAdmin
{ {
NodeService::applyAuthNode(); NodeService::applyAuthNode();
$list = (array)Db::name('SystemMenu')->where(['status' => '1'])->order('sort asc,id asc')->select(); $list = (array)Db::name('SystemMenu')->where(['status' => '1'])->order('sort asc,id asc')->select();
$menus = $this->_filterMenu(ToolsService::arr2tree($list), NodeService::get()); $menus = $this->_filterMenuData(ToolsService::arr2tree($list), NodeService::get(), !!session('user'));
return view('', ['title' => '系统管理', 'menus' => $menus]); return view('', ['title' => '系统管理', 'menus' => $menus]);
} }
/** /**
* 后台主菜单权限过滤 * 后台主菜单权限过滤
* @param array $menus * @param array $menus 当前菜单列表
* @param array $nodes * @param array $nodes 系统权限节点数据
* @param bool $isLogin 是否已经登录
* @return array * @return array
*/ */
private function _filterMenu($menus, $nodes) private function _filterMenuData($menus, $nodes, $isLogin)
{ {
foreach ($menus as $key => &$menu) { foreach ($menus as $key => &$menu) {
// 存在子菜单时,直接使用递归处理 !empty($menu['sub']) && $menu['sub'] = $this->_filterMenuData($menu['sub'], $nodes, $isLogin);
if (!empty($menu['sub'])): if (!empty($menu['sub'])) {
$menu['sub'] = $this->_filterMenu($menu['sub'], $nodes);
endif;
if (!empty($menu['sub'])):
$menu['url'] = '#'; $menu['url'] = '#';
// 菜单链接以http开头时不做处理 } elseif (preg_match('/^https?\:/i', $menu['url'])) {
elseif (preg_match('/^https?\:/i', $menu['url'])) :
continue; continue;
// 菜单链接不为空时,判断登录状态及权限验证 } elseif ($menu['url'] !== '#') {
elseif ($menu['url'] !== '#') :
$node = join('/', array_slice(explode('/', preg_replace('/[\W]/', '/', $menu['url'])), 0, 3)); $node = join('/', array_slice(explode('/', preg_replace('/[\W]/', '/', $menu['url'])), 0, 3));
$menu['url'] = url($menu['url']); $menu['url'] = url($menu['url']);
// 节点需要验证验证,未登录时移除此菜单 if (isset($nodes[$node]) && $nodes[$node]['is_login'] && empty($isLogin)) {
if (isset($nodes[$node]) && $nodes[$node]['is_login'] && !session('user')) :
unset($menus[$key]); unset($menus[$key]);
// 节点需要权限验证,无权限时移除此菜单 } elseif (isset($nodes[$node]) && $nodes[$node]['is_auth'] && $isLogin && !auth($node)) {
elseif (isset($nodes[$node]) && $nodes[$node]['is_auth'] && session('user') && !auth($node)) :
unset($menus[$key]); unset($menus[$key]);
endif; }
// 非以上情况时,移除此菜单 } else {
else :
unset($menus[$key]); unset($menus[$key]);
endif; }
} }
return $menus; return $menus;
} }
@ -86,11 +79,6 @@ class Index extends BasicAdmin
*/ */
public function main() public function main()
{ {
if (session('user.password') === '21232f297a57a5a743894a0e4a801fc3') {
$url = url('admin/index/pass') . '?id=' . session('user.id');
$alert = ['type' => 'danger', 'title' => '安全提示', 'content' => "超级管理员默认密码未修改,建议马上<a href='javascript:void(0)' data-modal='{$url}'>修改</a>",];
$this->assign('alert', $alert);
}
$_version = Db::query('select version() as ver'); $_version = Db::query('select version() as ver');
return view('', ['mysql_ver' => array_pop($_version)['ver'], 'title' => '后台首页']); return view('', ['mysql_ver' => array_pop($_version)['ver'], 'title' => '后台首页']);
} }
@ -101,7 +89,7 @@ class Index extends BasicAdmin
public function pass() public function pass()
{ {
if (intval($this->request->request('id')) !== intval(session('user.id'))) { if (intval($this->request->request('id')) !== intval(session('user.id'))) {
$this->error('访问异常'); $this->error('只能修改当前用户的密码');
} }
if ($this->request->isGet()) { if ($this->request->isGet()) {
$this->assign('verify', true); $this->assign('verify', true);
@ -129,7 +117,7 @@ class Index extends BasicAdmin
if (intval($this->request->request('id')) === intval(session('user.id'))) { if (intval($this->request->request('id')) === intval(session('user.id'))) {
return $this->_form('SystemUser', 'user/form'); return $this->_form('SystemUser', 'user/form');
} }
$this->error('访问异常'); $this->error('只能修改当前用户的资料');
} }
} }

View File

@ -52,6 +52,10 @@ class Log extends BasicAdmin
$db->where($key, 'like', "%{$get[$key]}%"); $db->where($key, 'like', "%{$get[$key]}%");
} }
} }
if (isset($get['date']) && $get['date'] !== '') {
list($start, $end) = explode('-', str_replace(' ', '', $get['date']));
$db->whereBetween('create_at', ["{$start} 00:00:00", "{$end} 23:59:59"]);
}
return parent::_list($db); return parent::_list($db);
} }

View File

@ -72,7 +72,9 @@ class Login extends BasicAdmin
*/ */
public function out() public function out()
{ {
LogService::write('系统管理', '用户退出系统成功'); if (session('user')) {
LogService::write('系统管理', '用户退出系统成功');
}
session('user', null); session('user', null);
session_destroy(); session_destroy();
$this->success('退出登录成功!', '@admin/login'); $this->success('退出登录成功!', '@admin/login');

View File

@ -51,12 +51,15 @@ class Plugs extends BasicAdmin
public function upload() public function upload()
{ {
$file = $this->request->file('file'); $file = $this->request->file('file');
$ext = pathinfo($file->getInfo('name'), 4); $ext = strtolower(pathinfo($file->getInfo('name'), 4));
$md5 = str_split($this->request->post('md5'), 16); $md5 = str_split($this->request->post('md5'), 16);
$filename = join('/', $md5) . ".{$ext}"; $filename = join('/', $md5) . ".{$ext}";
if (!in_array($ext, explode(',', strtolower(sysconf('storage_local_exts'))))) {
return json(['code' => 'ERROR', 'msg' => '文件上传类型受限']);
}
// 文件上传Token验证 // 文件上传Token验证
if ($this->request->post('token') !== md5($filename . session_id())) { if ($this->request->post('token') !== md5($filename . session_id())) {
return json(['code' => 'ERROR', '文件上传验证失败']); return json(['code' => 'ERROR', 'msg' => '文件上传验证失败']);
} }
// 文件上传处理 // 文件上传处理
if (($info = $file->move('static' . DS . 'upload' . DS . $md5[0], $md5[1], true))) { if (($info = $file->move('static' . DS . 'upload' . DS . $md5[0], $md5[1], true))) {
@ -64,7 +67,7 @@ class Plugs extends BasicAdmin
return json(['data' => ['site_url' => $site_url], 'code' => 'SUCCESS', 'msg' => '文件上传成功']); return json(['data' => ['site_url' => $site_url], 'code' => 'SUCCESS', 'msg' => '文件上传成功']);
} }
} }
return json(['code' => 'ERROR', '文件上传失败']); return json(['code' => 'ERROR', 'msg' => '文件上传失败']);
} }
/** /**

View File

@ -42,11 +42,15 @@ class User extends BasicAdmin
$this->title = '系统用户管理'; $this->title = '系统用户管理';
$get = $this->request->get(); $get = $this->request->get();
$db = Db::name($this->table)->where(['is_deleted' => '0']); $db = Db::name($this->table)->where(['is_deleted' => '0']);
foreach (['username', 'phone'] as $key) { foreach (['username', 'phone', 'mail'] as $key) {
if (isset($get[$key]) && $get[$key] !== '') { if (isset($get[$key]) && $get[$key] !== '') {
$db->where($key, 'like', "%{$get[$key]}%"); $db->where($key, 'like', "%{$get[$key]}%");
} }
} }
if (isset($get['date']) && $get['date'] !== '') {
list($start, $end) = explode('-', str_replace(' ', '', $get['date']));
$db->whereBetween('login_at', ["{$start} 00:00:00", "{$end} 23:59:59"]);
}
return parent::_list($db); return parent::_list($db);
} }
@ -111,7 +115,7 @@ class User extends BasicAdmin
} }
} else { } else {
$data['authorize'] = explode(',', isset($data['authorize']) ? $data['authorize'] : ''); $data['authorize'] = explode(',', isset($data['authorize']) ? $data['authorize'] : '');
$this->assign('authorizes', Db::name('SystemAuth')->select()); $this->assign('authorizes', Db::name('SystemAuth')->where(['status' => '1'])->select());
} }
} }

View File

@ -30,6 +30,7 @@
<th class='text-center'>权限名称</th> <th class='text-center'>权限名称</th>
<th class='text-center'>权限描述</th> <th class='text-center'>权限描述</th>
<th class='text-center'>状态</th> <th class='text-center'>状态</th>
<th class='text-center'>添加时间</th>
<th class='text-center'>操作</th> <th class='text-center'>操作</th>
</tr> </tr>
</thead> </thead>
@ -51,6 +52,7 @@
<span style="color:#090">使用中</span> <span style="color:#090">使用中</span>
{/if} {/if}
</td> </td>
<td class="text-center nowrap">{$vo.create_at|format_datetime}</td>
<td class='text-center nowrap'> <td class='text-center nowrap'>
{if auth("$classuri/edit")} {if auth("$classuri/edit")}

View File

@ -1,26 +1,39 @@
{extend name="extra@admin/content"} {extend name="extra@admin/content"}
{block name="content"} {block name="content"}
<form onsubmit="return false;" action="__SELF__" data-auto="true" method="post" class='form-horizontal' style='padding-top:20px'> <form onsubmit="return false;" action="__SELF__" data-auto="true" method="post"
class='form-horizontal layui-form' style='padding-top:20px'>
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label">Storage <span class="nowrap">(存储引擎)</span></label> <label class="col-sm-2 control-label">Storage <span class="nowrap">(存储引擎)</span></label>
<div class='col-sm-8'> <div class='col-sm-8'>
<select class="layui-input" name="storage_type" required="required"> <label class="think-radio">
<!--{if sysconf('storage_type') eq 'qiniu'}--> <!--{if sysconf('storage_type') eq 'local'}-->
<option value='local'>本地服务器</option> <input checked type="radio" name="storage_type" value="local" title="本地服务器" lay-ignore>
<option selected="selected" value='qiniu'>七牛云存储</option>
<option value='oss'>AliOSS存储</option>
<!--{elseif sysconf('storage_type') eq 'oss'}-->
<option value='local'>本地服务器</option>
<option value='qiniu'>七牛云存储</option>
<option selected="selected" value='oss'>AliOSS存储</option>
<!--{else}--> <!--{else}-->
<option selected="selected" value='local'>本地服务器</option> <input type="radio" name="storage_type" value="local" title="本地服务器" lay-ignore>
<option value='qiniu'>七牛云存储</option>
<option value='oss'>AliOSS存储</option>
<!--{/if}--> <!--{/if}-->
</select> 本地服务器
</label>
<label class="think-radio">
<!--{if sysconf('storage_type') eq 'qiniu'}-->
<input checked type="radio" name="storage_type" value="qiniu" title="七牛云存储" lay-ignore>
<!--{else}-->
<input type="radio" name="storage_type" value="qiniu" title="七牛云存储" lay-ignore>
<!--{/if}-->
七牛云存储
</label>
<label class="think-radio">
<!--{if sysconf('storage_type') eq 'oss'}-->
<input checked type="radio" name="storage_type" value="oss" title="AliOSS存储" lay-ignore>
<!--{else}-->
<input type="radio" name="storage_type" value="oss" title="AliOSS存储" lay-ignore>
<!--{/if}-->
AliOSS存储
</label>
<div class="help-block" data-storage-type="local">
文件将存储在本地服务器,请确保服务器的 ./static/upload 目录有写入权限
</div>
<div class="help-block" data-storage-type="qiniu"> <div class="help-block" data-storage-type="qiniu">
若还没有七牛云帐号,请点击 若还没有七牛云帐号,请点击
<a target="_blank" href="https://portal.qiniu.com/signup?code=3lhz6nmnwbple">免费申请10G存储空间</a>, <a target="_blank" href="https://portal.qiniu.com/signup?code=3lhz6nmnwbple">免费申请10G存储空间</a>,
@ -34,37 +47,43 @@
</div> </div>
<div class="hr-line-dashed" data-storage-type="qiniu"></div> <div class="hr-line-dashed" data-storage-type="qiniu"></div>
<div class="hr-line-dashed" data-storage-type="oss"></div>
<div class="form-group" data-storage-type="qiniu"> <div class="form-group" data-storage-type="qiniu">
<label class="col-sm-2 control-label">Region <span class="nowrap">(存储区域)</span></label> <label class="col-sm-2 control-label">Region <span class="nowrap">(存储区域)</span></label>
<div class='col-sm-8'> <div class='col-sm-8'>
<select class="layui-input" name="storage_qiniu_region" required="required"> <label class="think-radio">
<!--{if sysconf('storage_qiniu_region') eq '华东'}--> <!--{if sysconf('storage_qiniu_region') eq '华东'}-->
<option selected value='华东'>华东</option> <input checked type="radio" name="storage_qiniu_region" value="华东" lay-ignore>
<!--{else}--> <!--{else}-->
<option value='华东'>华东</option> <input type="radio" name="storage_qiniu_region" value="华东" lay-ignore>
<!--{/if}--> <!--{/if}-->
华东
</label>
<label class="think-radio">
<!--{if sysconf('storage_qiniu_region') eq '华北'}--> <!--{if sysconf('storage_qiniu_region') eq '华北'}-->
<option selected value='华北'>华北</option> <input checked type="radio" name="storage_qiniu_region" value="华北" lay-ignore>
<!--{else}--> <!--{else}-->
<option value='华北'>华北</option> <input type="radio" name="storage_qiniu_region" value="华北" lay-ignore>
<!--{/if}--> <!--{/if}-->
华北
</label>
<label class="think-radio">
<!--{if sysconf('storage_qiniu_region') eq '华南'}--> <!--{if sysconf('storage_qiniu_region') eq '华南'}-->
<option selected value='华南'>华南</option> <input checked type="radio" name="storage_qiniu_region" value="华南" lay-ignore>
<!--{else}--> <!--{else}-->
<option value='华南'>华南</option> <input type="radio" name="storage_qiniu_region" value="华南" lay-ignore>
<!--{/if}--> <!--{/if}-->
华南
</label>
<label class="think-radio">
<!--{if sysconf('storage_qiniu_region') eq '北美'}--> <!--{if sysconf('storage_qiniu_region') eq '北美'}-->
<option selected value='北美'>北美</option> <input checked type="radio" name="storage_qiniu_region" value="北美" lay-ignore>
<!--{else}--> <!--{else}-->
<option value='北美'>北美</option> <input type="radio" name="storage_qiniu_region" value="北美" lay-ignore>
<!--{/if}--> <!--{/if}-->
北美
</select> </label>
<p class="help-block">七牛云存储空间所在区域,需要严格对应储存所在区域才能上传文件</p> <p class="help-block">七牛云存储空间所在区域,需要严格对应储存所在区域才能上传文件</p>
</div> </div>
</div> </div>
@ -72,26 +91,41 @@
<div class="form-group" data-storage-type="qiniu"> <div class="form-group" data-storage-type="qiniu">
<label class="col-sm-2 control-label">Protocol <span class="nowrap">(访问协议)</span></label> <label class="col-sm-2 control-label">Protocol <span class="nowrap">(访问协议)</span></label>
<div class='col-sm-8'> <div class='col-sm-8'>
<select class="layui-input" name="storage_qiniu_is_https" required="required"> <!--{if sysconf('storage_qiniu_is_https')!=='1'}-->
<!--{if sysconf('storage_qiniu_is_https')!=='1'}--> <label class="think-radio">
<option selected value='0'>HTTP</option> <input checked type="radio" name="storage_qiniu_is_https" value="0" lay-ignore> http
<option value='1'>HTTPS</option> </label>
<!--{else}--> <label class="think-radio">
<option value='0'>HTTP</option> <input type="radio" name="storage_qiniu_is_https" value="1" lay-ignore> https
<option selected value='1'>HTTPS</option> </label>
<!--{/if}--> <!--{else}-->
</select> <label class="think-radio">
<p class="help-block">七牛云资源访问协议HTTP HTTPSHTTPS 需要配置证书才能使用</p> <input type="radio" name="storage_qiniu_is_https" value="0" lay-ignore> http
</label>
<label class="think-radio">
<input checked type="radio" name="storage_qiniu_is_https" value="1" lay-ignore> https
</label>
<!--{/if}-->
<p class="help-block">七牛云资源访问协议http httpshttps 需要配置证书才能使用</p>
</div> </div>
</div> </div>
<div class="form-group" data-storage-type="local">
<label class="col-sm-2 control-label">Allow <span class="nowrap">(允许类型)</span></label>
<div class='col-sm-8'>
<input type="text" name="storage_local_exts" required="required"
title="请输入系统文件上传后缀" placeholder="请输入系统文件上传后缀"
value="{:sysconf('storage_local_exts')}" class="layui-input">
<p class="help-block">设置系统允许上传文件的后缀多个以英文逗号隔开。如png,jpg,rar,doc</p>
</div>
</div>
<div class="form-group" data-storage-type="qiniu"> <div class="form-group" data-storage-type="qiniu">
<label class="col-sm-2 control-label">Bucket <span class="nowrap">(空间名称)</span></label> <label class="col-sm-2 control-label">Bucket <span class="nowrap">(空间名称)</span></label>
<div class='col-sm-8'> <div class='col-sm-8'>
<input type="text" name="storage_qiniu_bucket" required="required" title="请输入七牛云存储 Bucket (空间名称)" <input type="text" name="storage_qiniu_bucket" required="required"
placeholder="请输入七牛云存储 Bucket (空间名称)" value="{:sysconf('storage_qiniu_bucket')}" title="请输入七牛云存储 Bucket (空间名称)" placeholder="请输入七牛云存储 Bucket (空间名称)"
class="layui-input"> value="{:sysconf('storage_qiniu_bucket')}" class="layui-input">
<p class="help-block">填写七牛云存储空间名称static</p> <p class="help-block">填写七牛云存储空间名称static</p>
</div> </div>
</div> </div>
@ -99,8 +133,9 @@
<div class="form-group" data-storage-type="qiniu"> <div class="form-group" data-storage-type="qiniu">
<label class="col-sm-2 control-label">Domain <span class="nowrap">(访问域名)</span></label> <label class="col-sm-2 control-label">Domain <span class="nowrap">(访问域名)</span></label>
<div class='col-sm-8'> <div class='col-sm-8'>
<input type="text" name="storage_qiniu_domain" required="required" title="请输入七牛云存储 Domain (访问域名)" <input type="text" name="storage_qiniu_domain" required="required"
placeholder="请输入七牛云存储 Domain (访问域名)" value="{:sysconf('storage_qiniu_domain')}" class="layui-input"> title="请输入七牛云存储 Domain (访问域名)" placeholder="请输入七牛云存储 Domain (访问域名)"
value="{:sysconf('storage_qiniu_domain')}" class="layui-input">
<p class="help-block">填写七牛云存储访问域名static.ctolog.cc</p> <p class="help-block">填写七牛云存储访问域名static.ctolog.cc</p>
</div> </div>
</div> </div>
@ -108,8 +143,9 @@
<div class="form-group" data-storage-type="qiniu"> <div class="form-group" data-storage-type="qiniu">
<label class="col-sm-2 control-label">AccessKey <span class="nowrap">(访问密钥)</span></label> <label class="col-sm-2 control-label">AccessKey <span class="nowrap">(访问密钥)</span></label>
<div class='col-sm-8'> <div class='col-sm-8'>
<input type="text" name="storage_qiniu_access_key" required="required" title="请输入七牛云 AccessKey (访问密钥)" <input type="text" name="storage_qiniu_access_key" required="required"
placeholder="请输入七牛云 AccessKey (访问密钥)" value="{:sysconf('storage_qiniu_access_key')}" class="layui-input"> title="请输入七牛云 AccessKey (访问密钥)" placeholder="请输入七牛云 AccessKey (访问密钥)"
value="{:sysconf('storage_qiniu_access_key')}" class="layui-input">
<p class="help-block">可以在 [ 七牛云 > 个人中心 ] 设置并获取到访问密钥</p> <p class="help-block">可以在 [ 七牛云 > 个人中心 ] 设置并获取到访问密钥</p>
</div> </div>
</div> </div>
@ -118,9 +154,9 @@
<div class="form-group" data-storage-type="qiniu"> <div class="form-group" data-storage-type="qiniu">
<label class="col-sm-2 control-label">SecretKey <span class="nowrap">(安全密钥)</span></label> <label class="col-sm-2 control-label">SecretKey <span class="nowrap">(安全密钥)</span></label>
<div class='col-sm-8'> <div class='col-sm-8'>
<input type="password" name="storage_qiniu_secret_key" required="required" title="请输入七牛云 SecretKey (安全密钥)" <input type="password" name="storage_qiniu_secret_key" required="required"
placeholder="请输入七牛云 SecretKey (安全密钥)" value="{:sysconf('storage_qiniu_secret_key')}" title="请输入七牛云 SecretKey (安全密钥)" placeholder="请输入七牛云 SecretKey (安全密钥)"
maxlength="43" class="layui-input"> value="{:sysconf('storage_qiniu_secret_key')}" maxlength="43" class="layui-input">
<p class="help-block">可以在 [ 七牛云 > 个人中心 ] 设置并获取到安全密钥</p> <p class="help-block">可以在 [ 七牛云 > 个人中心 ] 设置并获取到安全密钥</p>
</div> </div>
</div> </div>
@ -128,24 +164,31 @@
<div class="form-group" data-storage-type="oss"> <div class="form-group" data-storage-type="oss">
<label class="col-sm-2 control-label">Protocol <span class="nowrap">(访问协议)</span></label> <label class="col-sm-2 control-label">Protocol <span class="nowrap">(访问协议)</span></label>
<div class='col-sm-8'> <div class='col-sm-8'>
<select class="layui-input" name="storage_oss_is_https" required="required"> <!--{if sysconf('storage_oss_is_https')!=='1'}-->
<!--{if sysconf('storage_oss_is_https')!=='1'}--> <label class="think-radio">
<option selected value='0'>HTTP</option> <input checked type="radio" name="storage_oss_is_https" value="0" lay-ignore> http
<option value='1'>HTTPS</option> </label>
<!--{else}--> <label class="think-radio">
<option value='0'>HTTP</option> <input type="radio" name="storage_oss_is_https" value="1" lay-ignore> https
<option selected value='1'>HTTPS</option> </label>
<!--{/if}--> <!--{else}-->
</select> <label class="think-radio">
<p class="help-block">AliOSS资源访问协议HTTP HTTPSHTTPS 需要配置证书才能使用</p> <input type="radio" name="storage_oss_is_https" value="0" lay-ignore> http
</label>
<label class="think-radio">
<input checked type="radio" name="storage_oss_is_https" value="1" lay-ignore> https
</label>
<!--{/if}-->
<p class="help-block">AliOSS资源访问协议http httpshttps 需要配置证书才能使用</p>
</div> </div>
</div> </div>
<div class="form-group" data-storage-type="oss"> <div class="form-group" data-storage-type="oss">
<label class="col-sm-2 control-label">Bucket <span class="nowrap">(空间名称)</span></label> <label class="col-sm-2 control-label">Bucket <span class="nowrap">(空间名称)</span></label>
<div class='col-sm-8'> <div class='col-sm-8'>
<input type="text" name="storage_oss_bucket" required="required" title="请输入AliOSS Bucket (空间名称)" <input type="text" name="storage_oss_bucket" required="required"
placeholder="请输入AliOSS Bucket (空间名称)" value="{:sysconf('storage_oss_bucket')}" class="layui-input"> title="请输入AliOSS Bucket (空间名称)" placeholder="请输入AliOSS Bucket (空间名称)"
value="{:sysconf('storage_oss_bucket')}" class="layui-input">
<p class="help-block">填写OSS存储空间名称static</p> <p class="help-block">填写OSS存储空间名称static</p>
</div> </div>
</div> </div>
@ -153,8 +196,9 @@
<div class="form-group" data-storage-type="oss"> <div class="form-group" data-storage-type="oss">
<label class="col-sm-2 control-label">Domain <span class="nowrap">(访问域名)</span></label> <label class="col-sm-2 control-label">Domain <span class="nowrap">(访问域名)</span></label>
<div class='col-sm-8'> <div class='col-sm-8'>
<input type="text" name="storage_oss_domain" required="required" title="请输入AliOSS存储 Domain (访问域名)" <input type="text" name="storage_oss_domain" required="required"
placeholder="请输入AliOSS存储 Domain (访问域名)" value="{:sysconf('storage_oss_domain')}" class="layui-input"> title="请输入AliOSS存储 Domain (访问域名)" placeholder="请输入AliOSS存储 Domain (访问域名)"
value="{:sysconf('storage_oss_domain')}" class="layui-input">
<p class="help-block">填写OSS存储外部访问域名static.ctolog.cc</p> <p class="help-block">填写OSS存储外部访问域名static.ctolog.cc</p>
</div> </div>
</div> </div>
@ -162,8 +206,9 @@
<div class="form-group" data-storage-type="oss"> <div class="form-group" data-storage-type="oss">
<label class="col-sm-2 control-label">AccessKey <span class="nowrap">(访问密钥)</span></label> <label class="col-sm-2 control-label">AccessKey <span class="nowrap">(访问密钥)</span></label>
<div class='col-sm-8'> <div class='col-sm-8'>
<input type="text" name="storage_oss_keyid" required="required" title="请输入16位AliOSS AccessKey (访问密钥)" <input type="text" name="storage_oss_keyid" required="required"
placeholder="请输入AliOSS AccessKey (访问密钥)" value="{:sysconf('storage_oss_keyid')}" maxlength="16" class="layui-input"> title="请输入16位AliOSS AccessKey (访问密钥)" placeholder="请输入AliOSS AccessKey (访问密钥)"
value="{:sysconf('storage_oss_keyid')}" maxlength="16" class="layui-input">
<p class="help-block">可以在 [ 阿里云 > 个人中心 ] 设置并获取到访问密钥</p> <p class="help-block">可以在 [ 阿里云 > 个人中心 ] 设置并获取到访问密钥</p>
</div> </div>
</div> </div>
@ -172,8 +217,9 @@
<div class="form-group" data-storage-type="oss"> <div class="form-group" data-storage-type="oss">
<label class="col-sm-2 control-label">SecretKey <span class="nowrap">(安全密钥)</span></label> <label class="col-sm-2 control-label">SecretKey <span class="nowrap">(安全密钥)</span></label>
<div class='col-sm-8'> <div class='col-sm-8'>
<input type="password" name="storage_oss_secret" required="required" title="请输入30位AliOSS SecretKey (安全密钥)" <input type="password" name="storage_oss_secret" required="required"
placeholder="请输入AliOSS SecretKey (安全密钥)" value="{:sysconf('storage_oss_secret')}" maxlength="30" class="layui-input"> title="请输入30位AliOSS SecretKey (安全密钥)" placeholder="请输入AliOSS SecretKey (安全密钥)"
value="{:sysconf('storage_oss_secret')}" maxlength="30" class="layui-input">
<p class="help-block">可以在 [ 阿里云 > 个人中心 ] 设置并获取到安全密钥</p> <p class="help-block">可以在 [ 阿里云 > 个人中心 ] 设置并获取到安全密钥</p>
</div> </div>
</div> </div>
@ -191,10 +237,19 @@
{block name="script"} {block name="script"}
<script> <script>
$(function () { (function () {
$('[name="storage_type"]').on('change', function () { window.form.render();
$("[data-storage-type]").not($("[data-storage-type='" + $(this).val() + "']").show()).hide();
}).trigger('change'); buildForm('{:sysconf("storage_type")}');
}); $('[name=storage_type]').on('click', function () {
buildForm($('[name=storage_type]:checked').val())
});
// 表单显示编译
function buildForm(value) {
var $tips = $("[data-storage-type='" + value + "']");
$("[data-storage-type]").not($tips.show()).hide();
}
})();
</script> </script>
{/block} {/block}

View File

@ -0,0 +1,41 @@
{extend name="extra@admin/content"}
{block name="content"}
<form onsubmit="return false;" action="__SELF__" data-auto="true" method="post" class='form-horizontal layui-form' style='padding-top:20px'>
<div class="form-group">
<label class="col-sm-2 control-label">State <span class="nowrap">(账号状态)</span></label>
<div class='col-sm-8'>
<input disabled class="layui-input layui-bg-gray" value="{if $result.code}短信剩余 {$result.num}{else}{$result.msg}{/if}">
<p class="help-block">肋通SMS接口状态若短信剩余条数不足时请提前充值。</p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Username <span class="nowrap">(平台账号)</span></label>
<div class='col-sm-8'>
<input type="text" name="sms_username" required="required" value="{:sysconf('sms_username')}"
title="请输入助通SMS接口平台账号" placeholder="请输入助通SMS接口平台账号" class="layui-input">
<p class="help-block">助通SMS接口平台账号平台管理 <a target="_blank" href="http://client.ztsms.cn">登录平台</a></p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Password <span class="nowrap">(平台密码)</span></label>
<div class='col-sm-8'>
<input type="password" name="sms_password" required="required" value="{:sysconf('sms_password')}"
title="请输入助通SMS接口平台密码" placeholder="请输入助通SMS接口平台密码" class="layui-input">
<p class="help-block">助通SMS接口平台密码需要在助通平台修改。</p>
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="col-sm-4 col-sm-offset-2">
<div class="layui-form-item text-center">
<button class="layui-btn" type="submit">保存配置</button>
</div>
</div>
</form>
{/block}

View File

@ -5,116 +5,109 @@
<div class="col-lg-6"> <div class="col-lg-6">
<table class="layui-box layui-table" lay-even lay-skin="line"> <table class="layui-box layui-table" lay-even lay-skin="line">
<colgroup> <colgroup>
<col width="40%"> <col width="30%">
<col> <col>
</colgroup> </colgroup>
<thead> <thead>
<tr> <tr>
<th class="text-center" colspan="2">系统信息</th> <th class="text-left" colspan="2">系统信息</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td>Think.Admin 版本</td> <td>Think.Admin 版本</td>
<td>{:sysconf('app_version')}</td> <td>{:sysconf('app_version')}</td>
</tr> </tr>
<tr> <tr>
<td>ThinkPHP 版本</td> <td>ThinkPHP 版本</td>
<td>{$Think.const.THINK_VERSION}</td> <td>{$Think.const.THINK_VERSION}</td>
</tr> </tr>
<tr> <tr>
<td>服务器操作系统</td> <td>服务器操作系统</td>
<td>{:php_uname('s')}</td> <td>{:php_uname('s')}</td>
</tr> </tr>
<tr> <tr>
<td>WEB运行环境</td> <td>WEB运行环境</td>
<td>{:php_sapi_name()}</td> <td>{:php_sapi_name()}</td>
</tr> </tr>
<tr> <tr>
<td>MySQL数据库版本</td> <td>MySQL数据库版本</td>
<td>{$mysql_ver}</td> <td>{$mysql_ver}</td>
</tr> </tr>
<tr> <tr>
<td>运行PHP版本</td> <td>运行PHP版本</td>
<td>{:phpversion()}</td> <td>{:phpversion()}</td>
</tr> </tr>
<tr> <tr>
<td>上传大小限制</td> <td>上传大小限制</td>
<td>{:ini_get('upload_max_filesize')}</td> <td>{:ini_get('upload_max_filesize')}</td>
</tr> </tr>
<tr> <tr>
<td>POST大小限制</td> <td>POST大小限制</td>
<td>{:ini_get('post_max_size')}</td> <td>{:ini_get('post_max_size')}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="col-lg-6"> <div class="col-lg-6">
<table class="layui-box layui-table" lay-even lay-skin="line"> <table class="layui-box layui-table" lay-even lay-skin="line">
<colgroup> <colgroup>
<col width="40%"> <col width="30%">
<col> <col>
</colgroup> </colgroup>
<thead> <thead>
<tr> <tr>
<th class="text-center" colspan="2">产品团队</th> <th class="text-left" colspan="2">产品团队</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td>产品名称</td> <td>产品名称</td>
<td>Think.Admin 管理框架</td> <td>Think.Admin 管理框架</td>
</tr> </tr>
<tr> <tr>
<td>产品研发团队</td> <td>产品研发团队</td>
<td>广州楚才信息科技有限公司</td> <td>广州楚才信息科技有限公司</td>
</tr> </tr>
<tr> <tr>
<td>产品DEMO体验</td> <td>产品DEMO体验</td>
<td> <td>
<a target="_blank" href="https://think.ctolog.com"> <a target="_blank" href="https://think.ctolog.com">https://think.ctolog.com</a>
https://think.ctolog.com </td>
</a> </tr>
</td> <tr>
</tr> <td>官方QQ群</td>
<tr> <td>
<td>官方QQ群</td> <a href="http://shang.qq.com/wpa/qunwpa?idkey=ae25cf789dafbef62e50a980ffc31242f150bc61a61164458216dd98c411832a">
<td> <img src="//pub.idqqimg.com/wpa/images/group.png" style="height:18px;width:auto"
<a target="_blank" href="http://shang.qq.com/wpa/qunwpa?idkey=ae25cf789dafbef62e50a980ffc31242f150bc61a61164458216dd98c411832a"> target="_blank">
<img src="//pub.idqqimg.com/wpa/images/group.png" style="height:18px;width:auto" alt="PHP微信开发群 (SDK)"> </a>
</a> </td>
</td> </tr>
</tr> <tr>
<tr> <td>BUG反馈</td>
<td>BUG反馈</td> <td>
<td> <a target="_blank" href="https://github.com/zoujingli/Think.Admin/issues">
<a target="_blank" href="https://github.com/zoujingli/Think.Admin/issues"> https://github.com/zoujingli/Think.Admin/issues
https://github.com/zoujingli/Think.Admin/issues </a>
</a> </td>
</td> </tr>
</tr> <tr>
<tr> <td>项目地址</td>
<td>项目地址</td> <td>
<td> <a target="_blank" href="https://github.com/zoujingli/Think.Admin">
<a target="_blank" href="https://github.com/zoujingli/Think.Admin"> https://github.com/zoujingli/Think.Admin
https://github.com/zoujingli/Think.Admin </a>
</a> </td>
</td> </tr>
</tr> <tr>
<tr> <td>公司官网</td>
<td>公司官网</td> <td><a target="_blank" href="http://www.cuci.cc">http://www.cuci.cc</a></td>
<td> </tr>
<a target="_blank" href="http://www.cuci.cc"> <tr>
http://www.cuci.cc <td>公司地址</td>
</a> <td>广东省 广州市 海珠区 世港国际公寓E1栋</td>
</td> </tr>
</tr>
<tr>
<td>公司地址</td>
<td>
广东省 广州市 海珠区 世港国际公寓E1栋
</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>

View File

@ -1,10 +1,9 @@
{extend name='extra@admin/content'} {extend name='extra@admin/content'}
{block name="button"} {block name="button"}
<div class="nowrap pull-right" style="margin-top:10px"> <div class="nowrap pull-right margin-top-10" style="margin-top:10px">
{if auth("$classuri/del")} {if auth("$classuri/del")}
<button data-update data-field='delete' data-action='{:url("$classuri/del")}' <button data-update data-field='delete' data-action='{:url("$classuri/del")}' class='layui-btn layui-btn-small layui-btn-danger'>
class='layui-btn layui-btn-small layui-btn-danger'>
<i class='fa fa-remove'></i> 删除日志 <i class='fa fa-remove'></i> 删除日志
</button> </button>
{/if} {/if}
@ -16,14 +15,14 @@
<!-- 表单搜索 开始 --> <!-- 表单搜索 开始 -->
<form class="layui-form layui-form-pane form-search" action="__SELF__" onsubmit="return false" method="get"> <form class="layui-form layui-form-pane form-search" action="__SELF__" onsubmit="return false" method="get">
<div class="layui-form-item layui-inline"> <div class="layui-form-item layui-inline">
<label class="layui-form-label" style="width:auto">操作者</label> <label class="layui-form-label">操作者</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input name="username" value="{$Think.get.username|default=''}" placeholder="请输入操作者" class="layui-input"> <input name="username" value="{$Think.get.username|default=''}" placeholder="请输入操作者" class="layui-input">
</div> </div>
</div> </div>
<div class="layui-form-item layui-inline"> <div class="layui-form-item layui-inline">
<label class="layui-form-label" style="width:auto">操作行为</label> <label class="layui-form-label">操作行为</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<select name='action' class='layui-select' lay-search=""> <select name='action' class='layui-select' lay-search="">
<option value=''> - 所有记录 -</option> <option value=''> - 所有记录 -</option>
@ -39,19 +38,27 @@
</div> </div>
<div class="layui-form-item layui-inline"> <div class="layui-form-item layui-inline">
<label class="layui-form-label" style="width:auto">操作内容</label> <label class="layui-form-label">操作内容</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input name="content" value="{$Think.get.content|default=''}" placeholder="请输入操作内容" class="layui-input"> <input name="content" value="{$Think.get.content|default=''}" placeholder="请输入操作内容" class="layui-input">
</div> </div>
</div> </div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">操作时间</label>
<div class="layui-input-inline">
<input name="date" id='range-date' value="{$Think.get.date|default=''}"
placeholder="请选择操作时间" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline"> <div class="layui-form-item layui-inline">
<button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button> <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
</div> </div>
</form> </form>
<!-- 表单搜索 结束 --> <!-- 表单搜索 结束 -->
<form onsubmit="return false;" data-auto="" method="POST"> <form onsubmit="return false;" data-auto="true" method="post">
<input type="hidden" value="resort" name="action"/> <input type="hidden" value="resort" name="action"/>
<table class="layui-table" lay-skin="line" lay-size="sm"> <table class="layui-table" lay-skin="line" lay-size="sm">
<thead> <thead>
@ -78,7 +85,7 @@
<td class='text-left'>{$vo.action}</td> <td class='text-left'>{$vo.action}</td>
<td class='text-left'>{$vo.content}</td> <td class='text-left'>{$vo.content}</td>
<td class='text-left'>{$vo.isp|default=$vo.ip}</td> <td class='text-left'>{$vo.isp|default=$vo.ip}</td>
<td class='text-left'>{$vo.create_at}</td> <td class='text-left'>{$vo.create_at|format_datetime}</td>
</tr> </tr>
{/foreach} {/foreach}
</tbody> </tbody>
@ -86,6 +93,7 @@
{if isset($page)}<p>{$page}</p>{/if} {if isset($page)}<p>{$page}</p>{/if}
<script> <script>
window.form.render(); window.form.render();
window.laydate.render({range: true, elem: '#range-date', format: 'yyyy/MM/dd'});
</script> </script>
</form> </form>
{/block} {/block}

View File

@ -8,9 +8,11 @@
<div class="login-container full-height"> <div class="login-container full-height">
<!-- 动态云层动画 开始 --> <!-- 动态云层动画 开始 -->
<div class="clouds clouds-footer"></div> <div class="clouds-container">
<div class="clouds"></div> <div class="clouds clouds-footer"></div>
<div class="clouds clouds-fast"></div> <div class="clouds"></div>
<div class="clouds clouds-fast"></div>
</div>
<!-- 动态云层动画 结束 --> <!-- 动态云层动画 结束 -->
<!-- 顶部导航条 开始 --> <!-- 顶部导航条 开始 -->
@ -41,13 +43,13 @@
<ul> <ul>
<li> <li>
<input name='username' class="hide"/> <input name='username' class="hide"/>
<input required="required" pattern="^\S{4,}$" value="admin" name="username" <input required="required" pattern="^\S{4,}$" value="" name="username"
autofocus="autofocus" autocomplete="off" class="login-input username" autofocus="autofocus" autocomplete="off" class="login-input username"
title="请输入4位及以上的字符" placeholder="请输入用户名/手机号码"/> title="请输入4位及以上的字符" placeholder="请输入用户名/手机号码"/>
</li> </li>
<li> <li>
<input name='password' class="hide"/> <input name='password' class="hide"/>
<input required="required" pattern="^\S{4,}$" value="admin" name="password" <input required="required" pattern="^\S{4,}$" value="" name="password"
type="password" autocomplete="off" class="login-input password" type="password" autocomplete="off" class="login-input password"
title="请输入4位及以上的字符" placeholder="请输入密码"/> title="请输入4位及以上的字符" placeholder="请输入密码"/>
</li> </li>

View File

@ -76,12 +76,12 @@
$('input.title-input').on('blur', function () { $('input.title-input').on('blur', function () {
var data = {list: [{name: this.name, value: this.value, node: this.getAttribute('data-node')}]}; var data = {list: [{name: this.name, value: this.value, node: this.getAttribute('data-node')}]};
$.form.load('{:url("save")}', data, 'POST', function (ret) { $.form.load('{:url("save")}', data, 'POST', function (ret) {
if(ret.code===0){ if (ret.code === 0) {
setTimeout(function(){ setTimeout(function () {
$.form.reload(); $.form.reload();
},3000); }, 3000);
$.msg.auto(ret); $.msg.auto(ret);
} }
return false; return false;
}); });
}); });
@ -91,12 +91,12 @@
data.list.push({name: this.name, value: this.checked ? 1 : 0, node: this.getAttribute('data-node')}); data.list.push({name: this.name, value: this.checked ? 1 : 0, node: this.getAttribute('data-node')});
}); });
$.form.load('{:url("save")}', data, 'POST', function (ret) { $.form.load('{:url("save")}', data, 'POST', function (ret) {
if(ret.code===0){ if (ret.code === 0) {
setTimeout(function(){ setTimeout(function () {
$.form.reload(); $.form.reload();
},3000); }, 3000);
$.msg.auto(ret); $.msg.auto(ret);
} }
return false; return false;
}); });
}); });

View File

@ -4,9 +4,11 @@
<label class="layui-form-label">用户账号</label> <label class="layui-form-label">用户账号</label>
<div class="layui-input-block"> <div class="layui-input-block">
{if $vo and $vo.username} {if $vo and $vo.username}
<input type="text" readonly="" disabled="" name="username" value='{$vo.username|default=""}' required="required" title="请输入用户名称" placeholder="请输入用户名称" class="layui-input disabled"> <input type="text" readonly="" disabled="" name="username" value='{$vo.username|default=""}'
required="required" title="请输入用户名称" placeholder="请输入用户名称" class="layui-input disabled">
{else} {else}
<input type="text" name="username" value='{$vo.username|default=""}' required="required" title="请输入用户名称" placeholder="请输入用户名称" class="layui-input"> <input type="text" name="username" value='{$vo.username|default=""}' required="required"
title="请输入用户名称" placeholder="请输入用户名称" class="layui-input">
{/if} {/if}
</div> </div>
</div> </div>
@ -16,13 +18,17 @@
<div class="layui-input-block"> <div class="layui-input-block">
{foreach $authorizes as $authorize} {foreach $authorizes as $authorize}
{if in_array($authorize['id'],$vo['authorize'])} {if in_array($authorize['id'],$vo['authorize'])}
<input type="checkbox" checked name="authorize[]" value="{$authorize.id}" title="{$authorize.title}"> <label class="think-checkbox">
<input type="checkbox" checked name="authorize[]" value="{$authorize.id}" lay-ignore> {$authorize.title}
</label>
{else} {else}
<input type="checkbox" name="authorize[]" value="{$authorize.id}" title="{$authorize.title}"> <label class="think-checkbox">
<input type="checkbox" checked name="authorize[]" value="{$authorize.id}" lay-ignore> {$authorize.title}
</label>
{/if} {/if}
{/foreach} {/foreach}
{if empty($authorizes)} {if empty($authorizes)}
<span style="color:#999;line-height:36px">未配置权限</span> <span class="color-desc" style="line-height:36px">未配置权限</span>
{/if} {/if}
</div> </div>
</div> </div>

View File

@ -4,9 +4,11 @@
<label class="layui-form-label">用户账号</label> <label class="layui-form-label">用户账号</label>
<div class="layui-input-block"> <div class="layui-input-block">
{if $vo and isset($vo.username)} {if $vo and isset($vo.username)}
<input type="text" readonly="" disabled="" name="username" value='{$vo.username|default=""}' required="required" title="请输入用户名称" placeholder="请输入用户名称" class="layui-input disabled"> <input readonly="readonly" disabled="disabled" name="username" value='{$vo.username|default=""}'
required="required" title="请输入用户名称" placeholder="请输入用户名称" class="layui-input layui-disabled">
{else} {else}
<input type="text" name="username" value='{$vo.username|default=""}' required="required" title="请输入用户名称" placeholder="请输入用户名称" class="layui-input"> <input name="username" value='{$vo.username|default=""}' required="required" pattern="^.{4,}$"
title="请输入用户名称" placeholder="请输入4位及以上字符用户名称" class="layui-input">
{/if} {/if}
</div> </div>
</div> </div>
@ -14,14 +16,16 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">联系手机</label> <label class="layui-form-label">联系手机</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="tel" autofocus name="phone" value='{$vo.phone|default=""}' pattern="^1[3-9][0-9]{9}$" title="请输入联系手机" placeholder="请输入联系手机" class="layui-input"> <input type="tel" autofocus name="phone" value='{$vo.phone|default=""}' pattern="^1[3-9][0-9]{9}$"
title="请输入联系手机" placeholder="请输入联系手机" class="layui-input">
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">联系邮箱</label> <label class="layui-form-label">联系邮箱</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="mail" pattern="^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$" value='{$vo.mail|default=""}' title="请输入联系邮箱" placeholder="请输入联系邮箱" class="layui-input"> <input name="mail" pattern="^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$"
value='{$vo.mail|default=""}' title="请输入联系邮箱" placeholder="请输入联系邮箱" class="layui-input">
</div> </div>
</div> </div>
@ -31,13 +35,17 @@
<div class="layui-input-block"> <div class="layui-input-block">
{foreach $authorizes as $authorize} {foreach $authorizes as $authorize}
{if in_array($authorize['id'],$vo['authorize'])} {if in_array($authorize['id'],$vo['authorize'])}
<input type="checkbox" checked name="authorize[]" value="{$authorize.id}" title="{$authorize.title}"> <label class="think-checkbox">
<input type="checkbox" checked name="authorize[]" value="{$authorize.id}" lay-ignore> {$authorize.title}
</label>
{else} {else}
<input type="checkbox" name="authorize[]" value="{$authorize.id}" title="{$authorize.title}"> <label class="think-checkbox">
<input type="checkbox" checked name="authorize[]" value="{$authorize.id}" lay-ignore> {$authorize.title}
</label>
{/if} {/if}
{/foreach} {/foreach}
{if empty($authorizes)} {if empty($authorizes)}
<span style="color:#999;line-height:36px">未配置权限</span> <span class="color-desc" style="line-height:36px">未配置权限</span>
{/if} {/if}
</div> </div>
</div> </div>
@ -46,11 +54,11 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">用户描述</label> <label class="layui-form-label">用户描述</label>
<div class="layui-input-block"> <div class="layui-input-block">
<textarea placeholder="请输入用户描述" title="请输入用户描述" class="layui-textarea" name="desc">{$vo.desc|default=""}</textarea> <textarea placeholder="请输入用户描述" title="请输入用户描述" class="layui-textarea"
name="desc">{$vo.desc|default=""}</textarea>
</div> </div>
</div> </div>
<div class="hr-line-dashed"></div> <div class="hr-line-dashed"></div>
<div class="layui-form-item text-center"> <div class="layui-form-item text-center">
@ -59,5 +67,4 @@
<button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗?" data-close>取消编辑</button> <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗?" data-close>取消编辑</button>
</div> </div>
<script>window.form.render();</script>
</form> </form>

View File

@ -16,19 +16,34 @@
<!-- 表单搜索 开始 --> <!-- 表单搜索 开始 -->
<form class="layui-form layui-form-pane form-search" action="__SELF__" onsubmit="return false" method="get"> <form class="layui-form layui-form-pane form-search" action="__SELF__" onsubmit="return false" method="get">
<div class="layui-form-item layui-inline"> <div class="layui-form-item layui-inline">
<label class="layui-form-label" style="width:auto">用户名</label> <label class="layui-form-label">用户名</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input name="username" value="{$Think.get.username|default=''}" placeholder="请输入用户名" class="layui-input"> <input name="username" value="{$Think.get.username|default=''}" placeholder="请输入用户名" class="layui-input">
</div> </div>
</div> </div>
<div class="layui-form-item layui-inline"> <div class="layui-form-item layui-inline">
<label class="layui-form-label" style="width:auto">手机号</label> <label class="layui-form-label">手机号</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<input name="phone" value="{$Think.get.phone|default=''}" placeholder="请输入手机号" class="layui-input"> <input name="phone" value="{$Think.get.phone|default=''}" placeholder="请输入手机号" class="layui-input">
</div> </div>
</div> </div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">电子邮箱</label>
<div class="layui-input-inline">
<input name="mail" value="{$Think.get.mail|default=''}" placeholder="请输入电子邮箱" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">登录时间</label>
<div class="layui-input-inline">
<input name="date" id='range-date' value="{$Think.get.date|default=''}"
placeholder="请选择登录时间" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline"> <div class="layui-form-item layui-inline">
<button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button> <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
</div> </div>
@ -46,13 +61,13 @@
<th class='list-table-check-td'> <th class='list-table-check-td'>
<input data-none-auto="" data-check-target='.list-check-box' type='checkbox'/> <input data-none-auto="" data-check-target='.list-check-box' type='checkbox'/>
</th> </th>
<th class='text-center'>用户账号</th> <th class='text-left'>用户账号</th>
<th class='text-center'>手机号</th> <th class='text-left'>手机号</th>
<th class='text-center'>电子邮箱</th> <th class='text-left'>电子邮箱</th>
<th class='text-center'>登录次数</th> <th class='text-left'>登录次数</th>
<th class='text-center'>最后登录</th> <th class='text-left'>最后登录</th>
<th class='text-center'>状态</th> <th class='text-left'>状态</th>
<th class='text-center'>操作</th> <th class='text-left'>操作</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -61,19 +76,29 @@
<td class='list-table-check-td'> <td class='list-table-check-td'>
<input class="list-check-box" value='{$vo.id}' type='checkbox'/> <input class="list-check-box" value='{$vo.id}' type='checkbox'/>
</td> </td>
<td class='text-center'>{$vo.username}</td> <td class='text-left nowrap'>
<td class='text-center'>{$vo.phone|default="<span style='color:#ccc'>还没有设置手机号</span>"}</td> {$vo.username}
<td class='text-center'>{$vo.mail|default="<span style='color:#ccc'>还没有设置邮箱</span>"}</td> </td>
<td class='text-center'>{$vo.login_num|default="<span style='color:#ccc'>从未登录</span>"}</td> <td class='text-left nowrap'>
<td class='text-center'>{$vo.login_at|default="<span style='color:#ccc'>从未登录</span>"}</td> {$vo.phone|default="<span class='color-desc'>还没有设置手机号</span>"}
<td class='text-center'> </td>
<td class='text-left nowrap'>
{$vo.mail|default="<span class='color-desc'>还没有设置邮箱</span>"}
</td>
<td class='text-left nowrap'>
{$vo.login_num|default="<span class='color-desc'>从未登录</span>"}
</td>
<td class='text-left nowrap'>
{$vo.login_at|format_datetime|default="<span class='color-desc'>从未登录</span>"}
</td>
<td class='text-left nowrap'>
{if $vo.status eq 0} {if $vo.status eq 0}
<span>已禁用</span> <span>已禁用</span>
{elseif $vo.status eq 1} {elseif $vo.status eq 1}
<span style="color:#090">使用中</span> <span style="color:#090">使用中</span>
{/if} {/if}
</td> </td>
<td class='text-center nowrap'> <td class='text-left nowrap'>
{if auth("$classuri/edit")} {if auth("$classuri/edit")}
<span class="text-explode">|</span> <span class="text-explode">|</span>
<a data-modal='{:url("$classuri/edit")}?id={$vo.id}' href="javascript:void(0)">编辑</a> <a data-modal='{:url("$classuri/edit")}?id={$vo.id}' href="javascript:void(0)">编辑</a>
@ -107,5 +132,8 @@
</table> </table>
{if isset($page)}<p>{$page}</p>{/if} {if isset($page)}<p>{$page}</p>{/if}
{/if} {/if}
<script>
window.laydate.render({range: true, elem: '#range-date', format: 'yyyy/MM/dd'});
</script>
</form> </form>
{/block} {/block}

View File

@ -4,9 +4,11 @@
<label class="layui-form-label">用户账号</label> <label class="layui-form-label">用户账号</label>
<div class="layui-input-block"> <div class="layui-input-block">
{if $vo and $vo.username} {if $vo and $vo.username}
<input type="text" readonly="" disabled="" name="username" value='{$vo.username|default=""}' required="required" title="请输入用户名称" placeholder="请输入用户名称" class="layui-input disabled"> <input readonly="readonly" disabled="disabled" name="username" value='{$vo.username|default=""}'
required="required" title="请输入用户名称" placeholder="请输入用户名称" class="layui-input layui-disabled">
{else} {else}
<input type="text" name="username" value='{$vo.username|default=""}' required="required" title="请输入用户名称" placeholder="请输入用户名称" class="layui-input"> <input name="username" value='{$vo.username|default=""}' required="required" title="请输入用户名称"
placeholder="请输入用户名称" class="layui-input">
{/if} {/if}
</div> </div>
</div> </div>
@ -15,7 +17,8 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">旧的密码</label> <label class="layui-form-label">旧的密码</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="password" autofocus name="oldpassword" value='' pattern="^\S{1,}$" required="" title="请输入旧的密码" placeholder="请输入旧的密码" class="layui-input"> <input type="password" autofocus name="oldpassword" value='' pattern="^\S{1,}$" required="" title="请输入旧的密码"
placeholder="请输入旧的密码" class="layui-input">
</div> </div>
</div> </div>
{/if} {/if}
@ -23,14 +26,16 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">新的密码</label> <label class="layui-form-label">新的密码</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="password" name="password" value='' pattern="^\S{1,}$" required="" title="请输入新的密码" placeholder="请输入新的密码" class="layui-input"> <input type="password" name="password" value='' pattern="^\S{1,}$" required="" title="请输入新的密码"
placeholder="请输入新的密码" class="layui-input">
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">重复密码</label> <label class="layui-form-label">重复密码</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="password" name="repassword" value='' pattern="^\S{1,}$" required="" title="请输入重复密码" placeholder="请输入重复密码" class="layui-input"> <input type="password" name="repassword" value='' pattern="^\S{1,}$" required="" title="请输入重复密码"
placeholder="请输入重复密码" class="layui-input">
</div> </div>
</div> </div>