修正文章编辑摘要获取和一些小细节

This commit is contained in:
liyukun 2022-01-11 23:39:49 +08:00
parent 51902c2b0e
commit 6343c7af63
7 changed files with 28 additions and 25 deletions

View File

@ -137,6 +137,7 @@ class Advert extends AuthController
if ($data['url'] == "") return app("json")->fail("链接地址不能为空"); if ($data['url'] == "") return app("json")->fail("链接地址不能为空");
if (is_array($data['cover_path'])) $data['cover_path'] = $data['cover_path'][0]; if (is_array($data['cover_path'])) $data['cover_path'] = $data['cover_path'][0];
$data['user_id'] = $this->adminId;//默认修改你 $data['user_id'] = $this->adminId;//默认修改你
if (filter_var($data['url'], FILTER_VALIDATE_URL) === false) return app("json")->fail("链接地址不合法");
if ($id == "") { if ($id == "") {
//判断下用户是否存在 //判断下用户是否存在
$info = aModel::where('url', $data['url'])->find(); $info = aModel::where('url', $data['url'])->find();

View File

@ -96,7 +96,7 @@ class Article extends AuthController
$content = $data['content']; $content = $data['content'];
} }
//判断摘要是否为空,为空则从内容摘取 //判断摘要是否为空,为空则从内容摘取
$data['abstract'] = $data['abstract'] ?: mb_substr($content, 0, 100); $data['abstract'] = $data['abstract'] ?: mb_substr(strip_tags($content), 0, 100);
unset($data['content']); unset($data['content']);
if ($data['is_recommend']) $data['is_recommend'] = 1; if ($data['is_recommend']) $data['is_recommend'] = 1;
if ($data['is_hot']) $data['is_hot'] = 1; if ($data['is_hot']) $data['is_hot'] = 1;

View File

@ -9,7 +9,15 @@
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12">
<div class="card"> <div class="card">
<div class="card-header"><h4>搜索</h4></div> <div class="card-header">
<h4>搜索</h4>
<ul class="card-actions">
<li>
<button type="button" data-toggle="tooltip" title="" data-original-title="返回"
onclick="history.back(-1);return false;"><i class="mdi mdi-undo"></i></button>
</li>
</ul>
</div>
<div class="card-body"> <div class="card-body">
<form class="form-inline searchForm" onsubmit="return false;"> <form class="form-inline searchForm" onsubmit="return false;">
<div class="form-group"> <div class="form-group">

View File

@ -23,25 +23,21 @@
<div class="form-group col-md-12"> <div class="form-group col-md-12">
<label>文章名称</label> <label>文章名称</label>
<input type="hidden" name="id" value="{$info.id}"> <input type="hidden" name="id" value="{$info.id}">
<input type="text" class="form-control" id="title" name="title" placeholder="文章名称" <input type="text" class="form-control" id="title" name="title" placeholder="文章名称" value="{$info.title}"/>
value="{$info.title}"/>
</div> </div>
<div class="form-group col-md-12"> <div class="form-group col-md-12">
<label for="category_id">栏目分类</label> <label for="category_id">栏目分类</label>
<div class="form-controls"> <div class="form-controls">
<select name="category_id" id="category_id" class="form-control"> <select name="category_id" id="category_id" class="form-control">
<option value="0">请选择</option>
{volist name="category" id="vo"} {volist name="category" id="vo"}
<option value="{$vo.id}" {if $vo.id== $info.category_id}selected{ <option value="{$vo.id}" {if $vo.id == $info.category_id}selected{/if}>{$vo.html}{$vo.title}</option>
/if}>{$vo.html}{$vo.title}</option>
{/volist} {/volist}
</select> </select>
</div> </div>
</div> </div>
<div class="form-group col-md-12"> <div class="form-group col-md-12">
<label for="author">作者</label> <label for="author">作者</label>
<input type="text" class="form-control" id="author" name="author" placeholder="原作者" <input type="text" class="form-control" id="author" name="author" placeholder="原作者" value="{$info.author}"/>
value="{$info.author}"/>
</div> </div>
<div class="form-group col-md-12"> <div class="form-group col-md-12">
<label>主图</label> <label>主图</label>
@ -134,15 +130,6 @@
</label> </label>
</div> </div>
</div> </div>
<div class="form-group row col-md-2">
<div class="col-xs-6">显示</div>
<div class="col-xs-6">
<label class="lyear-switch switch-solid switch-primary">
<input type="checkbox" name="display" {if $info.is_top}checked{/if}>
<span></span>
</label>
</div>
</div>
<div class="form-group col-md-12"> <div class="form-group col-md-12">
<label for="abstract">排序</label> <label for="abstract">排序</label>
<input type="text" class="form-control" name="sort" placeholder="请输入排序" <input type="text" class="form-control" name="sort" placeholder="请输入排序"

File diff suppressed because one or more lines are too long

View File

@ -2061,7 +2061,8 @@ fieldset[disabled] .btn-dark:hover {
-webkit-box-pack: justify; -webkit-box-pack: justify;
justify-content: space-between; justify-content: space-between;
} }
.btn-group-justified .btn { .btn-group-justified .btn,
.btn-group-justified .btn-group {
width: 100%; width: 100%;
} }
.btn-group-round .btn:first-child { .btn-group-round .btn:first-child {

View File

@ -324,11 +324,11 @@ if (typeof jQuery === "undefined") {
var navTabParam = $navTab.length ? self._getParam($navTab) : {}; var navTabParam = $navTab.length ? self._getParam($navTab) : {};
//change storage active status //change storage active status
var storage = self._storage(); var storage = self._storage();
if (storage[prevNavTabParam.id]) { if (storage[prevNavTabParam.did]) {
storage[prevNavTabParam.id].active = false; storage[prevNavTabParam.did].active = false;
} }
if (storage[navTabParam.id]) { if (storage[navTabParam.did]) {
storage[navTabParam.id].active = true; storage[navTabParam.did].active = true;
} }
self._resetStorage(storage); self._resetStorage(storage);
//active navTab and tabPane //active navTab and tabPane
@ -653,12 +653,17 @@ if (typeof jQuery === "undefined") {
$el = self.$element, $el = self.$element,
options = self.options, options = self.options,
storage, init = options.init, storage, init = options.init,
param; param,
tempParam;
if (supportStorage(options.cache)) { if (supportStorage(options.cache)) {
storage = self._storage(); storage = self._storage();
self._resetStorage({}); self._resetStorage({});
$.each(storage, function (k, v) { $.each(storage, function (k, v) {
self.create(v, false); self.create(v, false);
if (v.active) {
tempParam = self._getParam(v);
self._exist(tempParam).click();
}
}) })
} }
if ($.isEmptyObject(storage)) { if ($.isEmptyObject(storage)) {
@ -971,6 +976,7 @@ if (typeof jQuery === "undefined") {
if (!param) { if (!param) {
return storage[key]; return storage[key];
} }
tabIndex = Object.keys(storage).length;
storage[key] = param; storage[key] = param;
sessionStorage.multitabs = JSON.stringify(storage); sessionStorage.multitabs = JSON.stringify(storage);
return storage; return storage;