E:\WWWROOT\OtherPHPSystem\fastadmin\public\adminlogin88.php
http://localhost/adminlogin88.php/index/login
/cms
UPDATE `fa_auth_rule` SET `title` = '网站管理' WHERE `name` = 'cms';
UPDATE `fa_admin` SET `avatar` = '/assets/img/avatar.png' WHERE `id` = 1;
UPDATE `fa_user` SET `avatar` = '/assets/img/avatar.png' WHERE `id` = 1;
ALTER TABLE `fa_cms_channel`
MODIFY COLUMN `name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '名称' AFTER `parent_id`;
E:\WWWROOT\OtherPHPSystem\fastadmin\addons\cms\config.php
[
'name' => 'sitecopyright',
'title' => '网站版权说明',
'type' => 'string',
'content' => [],
'value' => 'Copyright © 2018-2022 版权所有',
'rule' => '',
'msg' => '',
'tip' => '网站底部常见的Copyright 20XX 版权所有等描述信息',
'ok' => '',
'extend' => '',
],
[
'name' => 'icp_license',
'title' => '网站备案号',
'type' => 'string',
'content' => [],
'value' => '豫ICP备12345678号',
'rule' => '',
'msg' => '',
'tip' => '中国大陆网站备案号http://beian.miit.gov.cn',
'ok' => '',
'extend' => '',
],
[
'name' => 'contact_tel',
'title' => '联系电话',
'type' => 'string',
'content' => [],
'value' => '0371-1234567',
'rule' => '',
'msg' => '',
'tip' => '座机、400电话或者其他联系号码',
'ok' => '',
'extend' => '',
],
[
'name' => 'contact_phone',
'title' => '联系手机',
'type' => 'string',
'content' => [],
'value' => '15612345678',
'rule' => '',
'msg' => '',
'tip' => '公司手机号或者个人手机号',
'ok' => '',
'extend' => '',
],
[
'name' => 'contact_email',
'title' => '联系邮箱',
'type' => 'string',
'content' => [],
'value' => '123@qq.com',
'rule' => '',
'msg' => '',
'tip' => '公司邮箱或者个人邮箱',
'ok' => '',
'extend' => '',
],
[
'name' => 'contact_qq',
'title' => '联系QQ',
'type' => 'string',
'content' => [],
'value' => '',
'rule' => '',
'msg' => '',
'tip' => '联系人的QQ号',
'ok' => '',
'extend' => '',
],
[
'name' => 'contact_weixin',
'title' => '联系微信',
'type' => 'string',
'content' => [],
'value' => 'webfirst',
'rule' => '',
'msg' => '',
'tip' => '联系人的微信号',
'ok' => '',
'extend' => '',
],
[
'name' => 'contact_address',
'title' => '联系地址',
'type' => 'string',
'content' => [],
'value' => '河南省郑州市',
'rule' => '',
'msg' => '',
'tip' => '一般为公司的办公地址',
'ok' => '',
'extend' => '',
],
[
'name' => 'contact_factory',
'title' => '工厂地址',
'type' => 'string',
'content' => [],
'value' => '工厂地址',
'rule' => '',
'msg' => '',
'tip' => '一般为公司的工厂地址',
'ok' => '',
'extend' => '',
],
[
'name' => 'contact_third',
'title' => '在线咨询链接',
'type' => 'string',
'content' => [],
'value' => 'tencent://message/?uin=12346578&Site=web&Menu=yes',
'rule' => '',
'msg' => '',
'tip' => '第三方独立沟通链接或客服链接',
'ok' => '',
'extend' => '',
],
[
'name' => 'custom_field1',
'title' => '自定义字段1',
'type' => 'string',
'content' => [],
'value' => '',
'rule' => '',
'msg' => '',
'tip' => '由程序员定义的字段,如:联系人姓名,为空则未启用。',
'ok' => '',
'extend' => '',
],
[
'name' => 'custom_field2',
'title' => '自定义字段2',
'type' => 'string',
'content' => [],
'value' => '',
'rule' => '',
'msg' => '',
'tip' => '由程序员定义的字段,如:顶部宣传语,为空则未启用。',
'ok' => '',
'extend' => '',
],
[
'name' => 'custom_field3',
'title' => '自定义字段3',
'type' => 'string',
'content' => [],
'value' => '',
'rule' => '',
'msg' => '',
'tip' => '由程序员定义的字段,如:某个专有链接,为空则未启用。',
'ok' => '',
'extend' => '',
],
[
'name' => 'code_in_head',
'title' => 'head标签中代码',
'type' => 'text',
'content' => [],
'value' => '',
'rule' => '',
'msg' => '',
'tip' => '一般要求放在< head/>标签之前的的第三方javascript代码',
'ok' => '',
'extend' => '',
],
[
'name' => 'code_in_body',
'title' => 'body标签中代码',
'type' => 'text',
'content' => [],
'value' => '',
'rule' => '',
'msg' => '',
'tip' => '一般要求放在< body/>标签之前的的第三方javascript代码',
'ok' => '',
'extend' => '',
],
[
'name' => 'syncphonesite',
'title' => '开启同步手机站',
'type' => 'radio',
'content' => [
1 => '开启',
0 => '关闭',
],
'value' => '0',
'rule' => 'required',
'msg' => '',
'tip' => '需要新建【default(设定皮肤)_mobile】目录,再添加一套手机模板。否则手机打开网站将显示错误',
'ok' => '',
'extend' => '',
],
E:\WWWROOT\OtherPHPSystem\fastadmin\addons\cms\config.html
'config'=>'system_user_id,sitename,sitelogo,title,keywords,description,indexpagesize,theme,qrcode,wxapp,donateimage,userpage,openedsite,searchtype,autopinyin,baidupush,usersidenav,loadmode,pagemode,indexloadmode,indexpagemode,cachelifetime,urlsuffix,syncphonesite,sitecopyright,icp_license,contact_tel,contact_phone,contact_email,contact_qq,contact_weixin,contact_address,contact_factory,contact_third,custom_field1,custom_field2,custom_field3,code_in_head,code_in_body',
E:\WWWROOT\OtherPHPSystem\fastadmin\addons\cms\controller\Base.php
/**
* 检测设备是否是手机
* @return bool
*/
public function checkMobileDevice(){
$_SERVER['ALL_HTTP'] = isset($_SERVER['ALL_HTTP']) ? $_SERVER['ALL_HTTP'] : '';
$mobile_browser = 0;
if(preg_match('/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone|iphone|ipad|ipod|android|xoom)/i', strtolower($_SERVER['HTTP_USER_AGENT']))) {
$mobile_browser++;
}
if((isset($_SERVER['HTTP_ACCEPT'])) and (strpos(strtolower($_SERVER['HTTP_ACCEPT']),'application/vnd.wap.xhtml+xml') !== false)) {
$mobile_browser++;
}
if(isset($_SERVER['HTTP_X_WAP_PROFILE'])) {
$mobile_browser++;
}
if(isset($_SERVER['HTTP_PROFILE'])) {
$mobile_browser++;
}
$mobile_ua = strtolower(substr($_SERVER['HTTP_USER_AGENT'],0,4));
$mobile_agents = array(
'w3c ','acs-','alav','alca','amoi','audi','avan','benq','bird','blac',
'blaz','brew','cell','cldc','cmd-','dang','doco','eric','hipt','inno',
'ipaq','java','jigs','kddi','keji','leno','lg-c','lg-d','lg-g','lge-',
'maui','maxo','midp','mits','mmef','mobi','mot-','moto','mwbp','nec-',
'newt','noki','oper','palm','pana','pant','phil','play','port','prox',
'qwap','sage','sams','sany','sch-','sec-','send','seri','sgh-','shar',
'sie-','siem','smal','smar','sony','sph-','symb','t-mo','teli','tim-',
'tosh','tsm-','upg1','upsi','vk-v','voda','wap-','wapa','wapi','wapp',
'wapr','webc','winw','winw','xda','xda-'
);
if(in_array($mobile_ua, $mobile_agents)) {
$mobile_browser++;
}
if(strpos(strtolower($_SERVER['ALL_HTTP']), 'operamini') !== false) {
$mobile_browser++;
}
// Pre-final check to reset everything if the user is on Windows
if(strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'windows') !== false) {
$mobile_browser = 0;
}
// But WP7 is also Windows, with a slightly different characteristic
if(strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'windows phone') !== false) {
$mobile_browser++;
}
if($mobile_browser>0) {
return true;
}
else {
return false;
}
}
// 同步手机站变更模板目录
if(!empty($config['syncphonesite']) && $this->checkMobileDevice()){
$config['theme'] = $config['theme'] . '_mobile';
}
// 设定主题模板目录
路径:line 41; line 194; E:\WWWROOT\OtherPHPSystem\fastadmin\application\admin\controller\cms\Channel.php
路径:line 34; E:\WWWROOT\OtherPHPSystem\fastadmin\application\admin\controller\cms\Builder.php
路径:line 52; line 272; E:\WWWROOT\OtherPHPSystem\fastadmin\application\admin\controller\cms\Archives.php
路径:line 176; E:\WWWROOT\OtherPHPSystem\fastadmin\addons\cms\controller\Api.php
路径:line 190; line 208; line 239; line 361; line 407; line 491; E:\WWWROOT\OtherPHPSystem\fastadmin\addons\cms\model\Channel.php
修改:weigh desc,id desc
修改为 weigh asc,id asc
路径:E:\WWWROOT\OtherPHPSystem\fastadmin\addons\cms\model\Channel.php
修改:line 269; desc
修改为 asc
修改:line 273; $orderway : 'desc';
修改为 $orderway : 'asc';
E:\WWWROOT\OtherPHPSystem\fastadmin\application\admin\controller\cms\Archives.php
/**
* 添加
*
* @return string
* @throws \think\Exception
*/
public function add()
{
if (false === $this->request->isPost()) {
// 权重默认随着id递增
$row_reigh = $this->model->max('id') + 1;
$this->view->assign('row_weigh', $row_reigh);
return $this->view->fetch();
}
$params = $this->request->post('row/a');
if (empty($params)) {
$this->error(__('Parameter %s can not be empty', ''));
}
$params = $this->preExcludeFields($params);
if ($this->dataLimit && $this->dataLimitFieldAutoFill) {
$params[$this->dataLimitField] = $this->auth->id;
}
$result = false;
Db::startTrans();
try {
//是否采用模型验证
if ($this->modelValidate) {
$name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
$validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate;
$this->model->validateFailException()->validate($validate);
}
$result = $this->model->allowField(true)->save($params);
Db::commit();
} catch (ValidateException|PDOException|Exception $e) {
Db::rollback();
$this->error($e->getMessage());
}
if ($result === false) {
$this->error(__('No rows were inserted'));
}
$this->success();
}
E:\WWWROOT\OtherPHPSystem\fastadmin\application\admin\view\cms\archives\add.html
0
修改为 {$row_weigh}
E:\WWWROOT\OtherPHPSystem\fastadmin\addons\cms\library\Bootstrap.php
$side = 2;
$window = $side * 2;
if ($this->lastPage < $window + 4) {
$block['first'] = $this->getUrlRange(1, $this->lastPage);
} elseif ($this->currentPage <= $window) {
$block['first'] = $this->getUrlRange(1, $window + 1);
$block['last'] = $this->getUrlRange($this->lastPage, $this->lastPage);
} elseif ($this->currentPage > ($this->lastPage - $window)) {
$block['first'] = $this->getUrlRange(1, 1);
$block['last'] = $this->getUrlRange($this->lastPage - ($window), $this->lastPage);
} else {
$block['first'] = $this->getUrlRange(1, 1);
$block['slider'] = $this->getUrlRange($this->currentPage - 1, $this->currentPage + 1);
$block['last'] = $this->getUrlRange($this->lastPage, $this->lastPage);
}
路径:E:\WWWROOT\OtherPHPSystem\fastadmin\addons\cms\model\Archives.php
修改:line 578;
prev
修改为: next
修改-添加:line 582;
$weigh = self::where(['id'=>$archives])->value('weigh');
$model = self::where('weigh', $type === 'next' ? '<' : '>', $weigh)->where('status', 'normal');
$model->order($type === 'prev' ? 'id desc' : 'id asc');
//修改为:
$model->order($type === 'next' ? 'weigh desc, id desc' : 'weigh asc, id asc');
E:\WWWROOT\OtherPHPSystem\fastadmin\application\admin\view\cms\channel\add.html
fa fa-toggle-on text-success fa-flip-horizontal text-gray fa-2x
修改为 fa fa-toggle-on text-success fa-2x
E:\WWWROOT\OtherPHPSystem\fastadmin\addons\cms\controller\Page.php
$config = get_addon_config('cms');
Config::set('cms.keywords', isset($page['keywords']) && $page['keywords'] ? $page['keywords'] : $config['keywords']);
Config::set('cms.description', isset($page['description']) && $page['description'] ? $page['description'] : $config['description']);
E:\WWWROOT\OtherPHPSystem\fastadmin\addons\cms\controller\Channel.php
Config::set('cms.keywords', isset($channel['keywords']) && $channel['keywords'] ? $channel['keywords'] : $config['keywords']);
Config::set('cms.description', isset($channel['description']) && $channel['description'] ? $channel['description'] : $config['description']);
E:\WWWROOT\OtherPHPSystem\fastadmin\addons\cms\controller\Archives.php
Config::set('cms.keywords', isset($archives['keywords']) && $archives['keywords'] ? $archives['keywords'] : $config['keywords']);
Config::set('cms.description', isset($archives['description']) && $archives['description'] ? $archives['description'] : $config['description']);
E:\WWWROOT\OtherPHPSystem\fastadmin\application\admin\controller\cms\Archives.php
// 自动提取关键词
if(empty($params['keywords'])){
$keywords = \addons\cms\library\Service::getContentTags($params['title']);
$keywords = in_array($params['title'], $keywords) ? [] : $keywords;
$keywords = array_filter(array_merge([$params['tags']], $keywords));
$params['keywords'] = implode(',', $keywords);
}
// 自动提取描述
if(empty($params['description']) && !empty($params['content'])){
$description = mb_substr(strip_tags(str_replace([' ', "\r", "\n", "\t"], ' ', $params['content'])), 0, 150);
$params['description'] = $description;
}
// 自动提取缩略图 todo 目前仅提取后台自行上传和手动下载的。不提取远程图片
if(empty($params['image']) && false !== stripos($params['content'], '/uploads/')){
$matches = [];
preg_match('/<img src="(.*?)"/i', $params['content'], $matches);
if(isset($matches[1])){
$params['image'] = $matches[1];
}
}
E:\WWWROOT\OtherPHPSystem\fastadmin\public\assets\css\backend.css
#c-title{
background-color: #deffde;
}
E:\WWWROOT\OtherPHPSystem\fastadmin\public\assets\css\backend.min.css
#c-title{background-color:#deffde;}
E:\WWWROOT\OtherPHPSystem\fastadmin\addons\cms\data\words.dic
最先进科学
史上最低价
最受欢迎
最大程度
最新技术
最新科学
最先进
最便宜
最流行
最时尚
最聚拢
最符合
最舒适
最低级
最低价
最高级
最高端
最奢侈
最优秀
最佳
最具
最爱
最赚
最优
最好
最大
最高
最低
最底
最先
最后
最新
大品牌之一
仅此一次
仅此一款
最后一波
中国第一
全网第一
销量第一
排名第一
独一无二
全国第一
第一品牌
唯一
遗留
一天
第一
销冠
NO.1
TOP1
国家级
国际级
世界级
千万级
百万级
超甲级
星级
甲级
第一
第二
三甲
十强
百强
5A
翘楚之作
不可再生
不可复制
绝无仅有
寸土寸金
淋漓尽致
无与伦比
顶级享受
前所未有
无人能及
非此莫属
顶级
顶尖
尖端
高级
极品
极佳
绝佳
绝对
终极
极致
致极
极具
完美
绝佳
极佳
至尊
至臻
臻品
臻致
臻席
压轴
问鼎
空前
绝后
绝版
无双
巅峰
顶级
鼎级
鼎冠
定鼎
完美
唯一
卓越
卓著
前无古人后无来者
绝无仅有
绝不在有
稀世珍宝
千金难求
世所罕见
不可多得
空前绝后
寥寥无几
屈指可数
绝版
珍稀
臻稀
稀少
开发者
缔造者
创始者
发明者
独家
独创
独据
国家领导人推荐
填补国内空白
全国销量冠军
国际品质
中国驰名
首屈一指
全国首家
首个
首款
独家
首发
首席
首府
首选
国门
国宅
首次
黄金旺铺
黄金价值
黄金地段
商品已注册驰名商标
领先上市
驰名商标
掌门人
大牌
金牌
名牌
王牌
巨星
著名
至尊
巅峰
之王
王者
领袖
皇家
世界领先
遥遥领先
领导者
领袖
引领
创领
领航
耀领
史无前例
前无古人
百分之百
永久
万能
祖传
特效
无敌
纯天然
正品
超强
100%
领导人推荐
专家推荐
特供
专供
无需国家质量检测
质量免检
免抽检
免检
点击有惊喜
点击领奖
恭喜获奖
全民免单
点击获取
点击转身
领取奖品
抽奖
错过就没机会了
再不抢就没了
史上最低价
不会再便宜
未曾有过的
价格你来定
即将售罄
错过不再
错过即无
万人疯抢
全民疯抢
免费领
免费住
0首付
免首付
零距离
售空
抢购
让孩子赢在起跑线上
一站式教育
入住学区房
教育护航
优先入学
教育无忧
全程无忧
起跑线
升学
买个房啥都解决了
承诺户口
蓝印户口
承诺移民
升值潜力无线
炒股不如买房
买到即赚到
升值价值
价值洼地
价值天成
千亿价值
投资回报
众筹
抄涨
随时结束
随时涨价
马上降价
购物大趴
倒计时
趁现在
周年庆
特惠趴
品牌团
仅限
周末
闪购
E:\WWWROOT\OtherPHPSystem\fastadmin\public\assets\js\backend\cms\archives.js
{field: 'weigh', title: __('Weigh'), operate: false, sortable: true},
修改为:{
field: 'weigh',
title: __('Weigh'),
formatter: function (value, row, index) {
return '<input type="text" class="form-control text-center text-weigh" data-id="' + row.id + '" value="' + value + '" style="width:60px;margin:0 auto;" />';
},
events: {
"dblclick .text-weigh": function (e) {
e.preventDefault();
e.stopPropagation();
return false;
}
},
sortable: true
},
Controller.index // 方法体内, 在$(document).on('click', '.btn-move', function () { 省略... }); 后边
//权重绑定事件
$(document).on("change", ".text-weigh", function () {
$(this).data("params", {weigh: $(this).val()});
Table.api.multi('', [$(this).data("id")], table, this);
return false;
});
E:\WWWROOT\OtherPHPSystem\fastadmin\addons\cms\library\Service.php
weigh desc,id desc
修改为:weigh asc,id asc
E:\WWWROOT\OtherPHPSystem\fastadmin\addons\cms\library\VicWord.php
// exit('我不认识的编码');
return false; // todo 遇到不认识的编码返回false
list($d, $i) = $this->getD($str, $i);
之前list($d, $i) = $this->getD($str, $i);
之前 // 遇到不认识的编码,跳过
if(false === $this->getD($str, $i)){
continue;
}
E:\WWWROOT\OtherPHPSystem\fastadmin\application\admin\view\cms\channel\add.html
<input id="c-pagesize" data-rule="required" class="form-control" name="row[pagesize]" type="number" value="12" data-tip="用于前台列表页分页">
E:\WWWROOT\OtherPHPSystem\fastadmin\application\admin\view\cms\channel\add.html
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-diyname" data-rule="required(single); diyname" class="form-control" name="row[diyname]" type="text" data-tip="用于伪静态规则中[:diyname]替换" style="width: 50%;">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="diyname-pinyin" class="btn btn-info" data-input-id="c-pinyin">拼音识别</button></span>
</div>
</div>
</div>
E:\WWWROOT\OtherPHPSystem\fastadmin\application\admin\view\cms\channel\edit.html
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-diyname" data-rule="required; diyname" class="form-control" name="row[diyname]" type="text" value="{$row.diyname|htmlentities}" data-tip="用于伪静态规则中[:diyname]替换" style="width: 50%;">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="diyname-pinyin" class="btn btn-info" data-input-id="c-pinyin">拼音识别</button></span>
</div>
</div>
</div>
E:\WWWROOT\OtherPHPSystem\fastadmin\public\assets\js\backend\cms\channel.js
var si;
$(document).on("keyup", "#c-name", function () {
var value = $(this).val();
if (value != '' && !value.match(/\n/)) {
clearTimeout(si);
si = setTimeout(function () {
Fast.api.ajax({
loading: false,
url: "cms/ajax/get_title_pinyin",
data: {title: value}
}, function (data, ret) {
$("#c-diyname").val(data.pinyin.substr(0, 100));
return false;
}, function (data, ret) {
return false;
});
}, 200);
}
});
//获取栏目拼音
var si;
$(document).on("click", "#diyname-pinyin", function () {
var _cname = $("#c-name");
var value = _cname.val();
if (value != '' && !value.match(/\n/)) {
clearTimeout(si);
si = setTimeout(function () {
Fast.api.ajax({
loading: false,
url: "cms/ajax/get_title_pinyin",
data: {title: value, check: 0}
}, function (data, ret) {
$("#c-diyname").val(data.pinyin.substr(0, 100));
return false;
}, function (data, ret) {
return false;
});
}, 200);
}
});
E:\WWWROOT\OtherPHPSystem\fastadmin\addons\cms\controller\Search.php
$query->where('a.title', 'like', '%' . $item . '%');
修改为:
$query->where('a.title|a.description', 'like', '%' . $item . '%');
路径:E:\WWWROOT\OtherPHPSystem\fastadmin\application\extra\upload.php
修改:line 20;
'maxsize' => '10mb',
修改为:
'maxsize' => '2048mb',
修改:line 28;
'multiple' => false,
修改为:
'multiple' => true,
修改:line 32;
'chunking' => false,
修改为:
'chunking' => true,
路径:E:\WWWROOT\OtherPHPSystem\fastadmin\public\assets\js\require-upload.js
修改:搜索;
class="btn btn-danger hidden faupload"
E:\WWWROOT\OtherPHPSystem\fastadmin\public\assets\js\require-backend.min.js
class="btn btn-danger hidden faupload" data-chunking="true" data-maxsize="2048M" data-timeout="600000"
E:\WWWROOT\OtherPHPSystem\fastadmin\public\assets\addons\ueditor\dialogs\attachment\attachment.js line:162;
acceptExtensions = (editor.getOpt('fileAllowFiles') || [".txt", ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".odt", ".ott", ".fodt", ".uot", ".xml", ".dot", ".htm", ".html", ".rtf", ".docm", ".zip", ".rar", ".tar", ".7z", ".tar.gz", ".tar.bz", ".tar.xz"]).join('').replace(/\./g, ',').replace(/^[,]/, '');
E:\WWWROOT\OtherPHPSystem\fastadmin\application\admin\controller\cms\Archives.php
protected $searchFields = 'id,title';
之后protected $multiFields = 'status,weigh';
E:\WWWROOT\OtherPHPSystem\fastadmin\addons\cms\config.html
<form id="config-form" class="edit-form form-horizontal" role="form" data-toggle="validator" method="POST" action="" style="display: none;">
// 非管理员隐藏元素
var lastlogin = localStorage.getItem('lastlogin');
if(lastlogin){
var lastloginObj = $.parseJSON(lastlogin);
if(1 !== parseInt(lastloginObj.id)){
$(".panel-heading").hide();
$(".table-config tr").hide();
$("input[name='row[sitename]']").parents('tr').show();
$("input[name='row[title]']").parents('tr').show();
$("input[name='row[keywords]']").parents('tr').show();
$("input[name='row[description]']").parents('tr').show();
$("input[name='row[sitecopyright]']").parents('tr').show();
$("input[name='row[icp_license]']").parents('tr').show();
$("input[name='row[contact_tel]']").parents('tr').show();
$("input[name='row[contact_phone]']").parents('tr').show();
$("input[name='row[contact_email]']").parents('tr').show();
$("input[name='row[contact_qq]']").parents('tr').show();
$("input[name='row[contact_weixin]']").parents('tr').show();
$("input[name='row[contact_address]']").parents('tr').show();
$("input[name='row[contact_factory]']").parents('tr').show();
$("input[name='row[custom_field1]']").parents('tr').show();
$("input[name='row[custom_field2]']").parents('tr').show();
$("input[name='row[custom_field3]']").parents('tr').show();
$("input[name='row[contact_third]']").parents('tr').show();
}
}
$("#config-form").show();
E:\WWWROOT\OtherPHPSystem\fastadmin\public\assets\js\backend\cms\channel.js
// 非管理员隐藏元素
var lastlogin = localStorage.getItem('lastlogin');
if(lastlogin){
var lastloginObj = $.parseJSON(lastlogin);
if(1 !== parseInt(lastloginObj.id)){
$("input[name='row" + '[type]' + "']").parents(".form-group").hide(); // 类型
$("select[name='row" + '[model_id]' + "']").parents(".form-group").hide(); // 模型
$("select[name='row" + '[parent_id]' + "']").parents(".form-group").hide(); // 上级栏目
$("button#fachoose-image").hide(); // 选择图片按钮
setTimeout(function () {
$("input[name='row" + '[channeltpl]_text' + "']").parents(".form-group").hide(); // 频道页模板
$("input[name='row" + '[listtpl]_text' + "']").parents(".form-group").hide(); // 列表页模板
$("input[name='row" + '[showtpl]_text' + "']").parents(".form-group").hide(); // 详情页模板
}, 100);
}
}
E:\WWWROOT\OtherPHPSystem\fastadmin\public\assets\js\backend\cms\archives.js
,adminhide: function () {
var lastlogin = localStorage.getItem('lastlogin');
if(lastlogin){
var lastloginObj = $.parseJSON(lastlogin);
if(1 != lastloginObj.id){
// 10秒内不断查找元素并处理
var __admin_elements = [],
admin_elements_load_time = Date.now(),
admin_elements_timer_handler = function(){
$("[id^='fachoose-']").each(function () {
var __that = $(this);
var __admin_element_id = __that.attr('id');
if(-1 !== __admin_elements.indexOf(__admin_element_id)){
return;
}
__that.hide();
__admin_elements.push(__admin_element_id);
});
// 超时10秒
if(10000 > (Date.now() -admin_elements_load_time)){
setTimeout(function(){admin_elements_timer_handler();}, 1000);
}
};
admin_elements_timer_handler();
}
}
}
Controller.api.adminhide();
E:\WWWROOT\OtherPHPSystem\fastadmin\addons\cms\controller\Channel.php
if (!$channel || $channel['status'] != 'normal') { 在这里... $this->error(__('No specified channel found')); }
分支内部 if('/sitemap.html' == $this->request->url()){
return $this->fetch('/sitemap');
}
if('/sitemap.xml' == $this->request->url()){
return \\think\Response::create($this->fetch('/sitemapxml'), 'html', 200, ['Content-Type' => 'text/xml; charset=utf-8']);
}
<input type="hidden" name="row[redirecturl]" value="referer">
E:\WWWROOT\OtherPHPSystem\fastadmin\addons\cms\controller\Diyform.php
unset($row['id']);
之后 // 处理用户自定义跳转链接
if(isset($row['redirecturl']) && !empty($row['redirecturl'])){
$diy_redirecturl = $row['redirecturl'];
unset($row['redirecturl']);
}
else{
$diy_redirecturl = '';
}
$this->success($diyform['successtips'] ? $diyform['successtips'] : '提交成功!', $redirecturl);
之前 // 提交表单可以自定义跳转链接
if(!empty($diy_redirecturl)){
if('referer' == $diy_redirecturl){
$redirecturl = null; // 默认跳转引用页
}
else{
$redirecturl = $diy_redirecturl;
}
}
!!!注意此修改会破坏插件URL路由
E:\WWWROOT\OtherPHPSystem\fastadmin\application\common\behavior\Common.php
addonBegin
函数体内 $uri_ext = $request->ext();
if($uri_ext && (!in_array($uri_ext, ['xml', Config::get('default_return_type')]))) {
throw new \think\exception\HttpException(404, 'uri suffix error!');
}
E:\WWWROOT\OtherPHPSystem\fastadmin_root\public_html\adminlogin88.php
E:\WWWROOT\OtherPHPSystem\fastadmin_root\public_html\index.php
// 定义当前运行的web目录
define('WEB_DIR', __DIR__ . DIRECTORY_SEPARATOR);
E:\WWWROOT\OtherPHPSystem\fastadmin_root\vendor\karsonzhang\fastadmin-addons\src\addons\Service.php
$addonsFile = ROOT_PATH . str_replace("/", DS, "public/assets/js/addons.js");
之后 if(defined('WEB_DIR') && strlen(WEB_DIR) > strlen(ROOT_PATH)){
$addonsFile = ROOT_PATH . str_replace("/", DS, basename(WEB_DIR) . "/assets/js/addons.js");
}
$assetsDir = ROOT_PATH . str_replace("/", DS, "public/assets/addons/{$name}/");
之后 if(defined('WEB_DIR') && strlen(WEB_DIR) > strlen(ROOT_PATH)){
$assetsDir = ROOT_PATH . str_replace("/", DS, basename(WEB_DIR) . "/assets/addons/{$name}/");
}
getCheckDirs
函数体内第一行 if(defined('WEB_DIR') && strlen(WEB_DIR) > strlen(ROOT_PATH)){
return [
'application',
'public',
basename(WEB_DIR)
];
}
E:\WWWROOT\OtherPHPSystem\fastadmin_root\application\admin\library\traits\Backend.php
$filePath = ROOT_PATH . DS . 'public' . DS . $file;
之后 if(defined('WEB_DIR') && strlen(WEB_DIR) > strlen(ROOT_PATH)){
$filePath = ROOT_PATH . DS . basename(WEB_DIR) . DS . $file;
}
E:\WWWROOT\OtherPHPSystem\fastadmin_root\application\common\library\Upload.php
$destDir = ROOT_PATH . 'public' . str_replace('/', DS, $uploadDir);
之后 if(defined('WEB_DIR') && strlen(WEB_DIR) > strlen(ROOT_PATH)){
$destDir = ROOT_PATH . basename(WEB_DIR) . str_replace('/', DS, $uploadDir);
}
E:\WWWROOT\OtherPHPSystem\fastadmin\application\admin\controller\general\Attachment.php
$attachmentFile = ROOT_PATH . '/public' . $params['url'];
之后 if(defined('WEB_DIR') && strlen(WEB_DIR) > strlen(ROOT_PATH)){
$attachmentFile = ROOT_PATH . basename(WEB_DIR) . $params['url'];
}
1、请先完成适配 SiteGround 空间修改
2、复制 public 目录中所有文件到 public 上级目录 (不需要的文件请自行删减)
根目录放入Apache的伪静态配置文件.htaccess
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?s=/$1 [QSA,PT,L]
###不能访问目录
RewriteRule ^addons - [F,L,NC]
RewriteRule ^application - [F,L,NC]
RewriteRule ^extend - [F,L,NC]
RewriteRule ^runtime - [F,L,NC]
RewriteRule ^thinkphp - [F,L,NC]
RewriteRule ^vendor - [F,L,NC]
###不能执行目录
RewriteRule ^assets/(.*).(php)$ – [F,L,NC]
RewriteRule ^template/(.*).(php)$ – [F,L,NC]
RewriteRule ^mobile/(.*).(php)$ – [F,L,NC]
RewriteRule ^static(.*).(php)$ – [F,L,NC]
RewriteRule ^statics(.*).(php)$ – [F,L,NC]
RewriteRule ^skin(.*).(php)$ – [F,L,NC]
RewriteRule ^skins(.*).(php)$ – [F,L,NC]
RewriteRule ^upload(.*).(php)$ – [F,L,NC]
RewriteRule ^uploads(.*).(php)$ – [F,L,NC]
</IfModule>
###限制后缀文件访问
<FilesMatch "\\.(txt|bak|inc|lib|sh|tpl|lbi|dwt|htm)$">
order deny,allow
deny from all
</FilesMatch>
E:\WWWROOT\OtherPHPSystem\fastadmin\index.php
define('APP_PATH', __DIR__ . '/application/');
require __DIR__ . '/thinkphp/start.php';
E:\WWWROOT\OtherPHPSystem\fastadmin\adminlogin88.php
define('APP_PATH', __DIR__ . '/application/');
require __DIR__ . '/thinkphp/base.php';
E:\WWWROOT\OtherPHPSystem\fastadmin_root\vendor\karsonzhang\fastadmin-addons\src\addons\Service.php
if(defined('WEB_DIR') && strlen(WEB_DIR) > strlen(ROOT_PATH)){
上边 $addonsFile = ROOT_PATH . str_replace("/", DS, "assets/js/addons.js");
if(defined('WEB_DIR') && strlen(WEB_DIR) > strlen(ROOT_PATH)){
上边 $assetsDir = ROOT_PATH . str_replace("/", DS, "assets/addons/{$name}/");
E:\WWWROOT\OtherPHPSystem\fastadmin_root\application\admin\library\traits\Backend.php
if(defined('WEB_DIR') && strlen(WEB_DIR) > strlen(ROOT_PATH)){
上边 $filePath = ROOT_PATH . DS . $file;
E:\WWWROOT\OtherPHPSystem\fastadmin_root\application\common\library\Upload.php
if(defined('WEB_DIR') && strlen(WEB_DIR) > strlen(ROOT_PATH)){
上边 $destDir = rtrim(ROOT_PATH, DS) . str_replace('/', DS, $uploadDir);
E:\WWWROOT\OtherPHPSystem\fastadmin\application\admin\controller\general\Attachment.php
if(defined('WEB_DIR') && strlen(WEB_DIR) > strlen(ROOT_PATH)){
上边 $attachmentFile = rtrim(ROOT_PATH, DS) . $params['url'];
E:\WWWROOT\OtherPHPSystem\fastadmin\application\admin\command\Addon.php
E:\WWWROOT\OtherPHPSystem\fastadmin\application\admin\command\Api.php
E:\WWWROOT\OtherPHPSystem\fastadmin\application\admin\command\Crud.php
E:\WWWROOT\OtherPHPSystem\fastadmin\application\admin\command\Install.php
E:\WWWROOT\OtherPHPSystem\fastadmin\application\admin\command\Min.php
!!!注意此修改会破坏插件URL路由
E:\WWWROOT\OtherPHPSystem\fastadmin\addons\cms\Cms.php
public function appInit()
函数体内第一行 $request = \\think\Request::instance();
$request_url = $request->url();
// 百度收录织梦文章多级目录URL,fastadmin-cms系统302跳转处理 todo 手机URL未处理 附带参数未处理如:?1590650404
if (2 < substr_count($request_url, '/') && false === strpos($request_url, 'admin')) {
$response_url = '/';
$request_url_array = explode('/', $request_url);
foreach($request_url_array as $item){
if(false !== stripos($item, '.html')){
$response_url .= '/' . $item;
}
else{
$response_url .= ucfirst($item);
}
}
header('Location:' . $response_url);
exit();
}
E:\WWWROOT\OtherPHPSystem\fastadmin\application\admin\model\cms\Block.php
return ['pcbanner' => 'PC轮播图', 'wapbanner' => 'Phone轮播图', 'indexfocus' => 'PC首页焦点图', 'downloadfocus' => 'PC下载频道页焦点图', 'newsfocus' => 'PC资讯频道页焦点图', 'productfocus' => 'PC产品频道页焦点图', 'uniappfocus' => 'UniAPP焦点图', 'wxappfocus' => '原生微信小程序焦点图'];
nginx:
location /h5/ {
try_files $uri /h5/index.html;
}
apache:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^h5/(.*) /h5/index.html [QSA,PT,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond $1 !^(h5)
RewriteRule ^(.*)$ index.php?s=/$1 [QSA,PT,L]
</IfModule>
!!!注意线上一定要删除此文件
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。