添加系统配置函数sysconf

This commit is contained in:
Anyon 2017-02-10 01:33:20 -05:00
parent e6d55c8126
commit 6c689d58b9
2 changed files with 19 additions and 3 deletions

View File

@ -12,8 +12,7 @@
<div class='logo'><img <div class='logo'><img
src="http://static.cdn.cuci.cc/2016/0414/af3c5d9fcf94b34113274f8c047755fc.png?imageMogr2/thumbnail/!160x56r/gravity/Center/crop/160x56/interlace/1" src="http://static.cdn.cuci.cc/2016/0414/af3c5d9fcf94b34113274f8c047755fc.png?imageMogr2/thumbnail/!160x56r/gravity/Center/crop/160x56/interlace/1"
onerror='this.src="http://basic.demo.cuci.cc/static/theme/img/cuci.png"' alt=""/></div> onerror='this.src="http://basic.demo.cuci.cc/static/theme/img/cuci.png"' alt=""/></div>
<form onsubmit="return false;" data-callback='logincallback' data-time="0.01" data-auto role="form" <form onsubmit="return false;" data-callback='logincallback' data-time="0.01" data-auto role="form" method="POST">
action="http://basic.demo.cuci.cc/admin-login.html" method="POST">
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<span class="fa fa-user input-icon"></span> <span class="fa fa-user input-icon"></span>
<input autofocus="true" autocomplete="off" class="form-control" name="username" placeholder="Username" <input autofocus="true" autocomplete="off" class="form-control" name="username" placeholder="Username"
@ -37,7 +36,7 @@
</form> </form>
</div> </div>
<p class='copyright'> <p class='copyright'>
<small>广州楚才信息科技有限公司 &copy; 2017</small> <small>广州楚才信息科技有限公司 &copy; {:date('Y')}</small>
</p> </p>
</div> </div>
<div class="hide"> <div class="hide">

View File

@ -1,5 +1,6 @@
<?php <?php
use think\Config; use think\Config;
use think\Db;
use Wechat\Loader; use Wechat\Loader;
use Wechat\WechatReceive; use Wechat\WechatReceive;
@ -50,4 +51,20 @@ function decode($string) {
$mod4 = strlen($data) % 4; $mod4 = strlen($data) % 4;
($mod4) && $data .= substr('====', $mod4); ($mod4) && $data .= substr('====', $mod4);
return unserialize(base64_decode($data)); return unserialize(base64_decode($data));
}
/**
* 从配置表读取配置信息
* @param string $name
* @return string
*/
function sysconf($name) {
static $conf = [];
if (empty($conf)) {
$list = Db::name('SystemConfig')->select();
foreach ($list as $vo) {
$conf[$vo['name']] = $vo['value'];
}
}
return isset($conf[$name]) ? $conf[$name] : '';
} }