mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2024-12-03 20:39:59 +08:00
留言新增是否登录
This commit is contained in:
parent
1fb3c7a37f
commit
29b55e58cf
33
application/admin/view/default/site/extends.html
Normal file
33
application/admin/view/default/site/extends.html
Normal file
@ -0,0 +1,33 @@
|
||||
{{include file="public/header" /}}
|
||||
|
||||
<!-- right content start -->
|
||||
<div class="content-right">
|
||||
<div class="content">
|
||||
<!-- table nav start -->
|
||||
{{include file="site/nav" /}}
|
||||
<!-- table nav end -->
|
||||
|
||||
<!-- form start -->
|
||||
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/site/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/site/index', ['nav_type'=>'extends'])}}" enctype="multipart/form-data">
|
||||
<div class="am-form-group">
|
||||
<label>{{$data.common_is_login_answer.name}}<span class="am-form-group-label-tips">{{$data.common_is_login_answer.describe}}</span></label>
|
||||
<select name="{{$data.common_is_login_answer.only_tag}}" class="am-radius chosen-select c-p" data-validation-message="{{$data.common_is_login_answer.error_tips}}" required>
|
||||
{{foreach $common_is_text_list as $v}}
|
||||
<option value="{{$v.id}}" {{if isset($data['common_is_login_answer']['value']) and $data['common_is_login_answer']['value'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
|
||||
{{/foreach}}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-form-group-refreshing">
|
||||
<input type="hidden" name="nav_type" value="{{$nav_type}}" />
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'处理中...'}">保存</button>
|
||||
</div>
|
||||
</form>
|
||||
<!-- form end -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- right content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
{{include file="public/footer" /}}
|
||||
<!-- footer end
|
@ -23,6 +23,9 @@
|
||||
<li {{if $nav_type eq 'search'}}class="am-active"{{/if}} data-type="search">
|
||||
<a href="{{:MyUrl('admin/site/index', ['nav_type'=>'search'])}}">搜索</a>
|
||||
</li>
|
||||
<li {{if $nav_type eq 'extends'}}class="am-active"{{/if}} data-type="extends">
|
||||
<a href="{{:MyUrl('admin/site/index', ['nav_type'=>'extends'])}}">扩展项</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
{{if in_array($nav_type, ['login', 'forgetpwd'])}}
|
||||
|
@ -11,6 +11,7 @@
|
||||
namespace app\service;
|
||||
|
||||
use think\Db;
|
||||
use app\service\UserService;
|
||||
|
||||
/**
|
||||
* 问答/留言服务层
|
||||
@ -186,6 +187,16 @@ class AnswerService
|
||||
*/
|
||||
public static function AnswerSave($params = [])
|
||||
{
|
||||
// 是否开启登录留言,管理员登录状态可继续操作
|
||||
if(MyC('common_is_login_answer') == 1 && session('admin') === null)
|
||||
{
|
||||
$user = UserService::LoginUserInfo();
|
||||
if(empty($user))
|
||||
{
|
||||
return DataReturn('请先登录', -400);
|
||||
}
|
||||
}
|
||||
|
||||
// 参数校验
|
||||
$p = [
|
||||
[
|
||||
|
Loading…
Reference in New Issue
Block a user